查看: 3316|回复: 17

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

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

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

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

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

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

[pre lang="ruby"]$脸图战斗 = true
$imported = {} if $imported.nil?
module YEA
  module BATTLE
    SKIP_PARTY_COMMAND = true
    BATTLESTATUS_NAME_FONT_SIZE = 20
    BATTLESTATUS_TEXT_FONT_SIZE = 16
    BATTLESTATUS_NO_ACTION_ICON = 185
    BATTLESTATUS_HPGAUGE_Y_PLUS = 11
    BATTLESTATUS_CENTER_FACES   = false
    HELP_TEXT_ALL_FOES        = "全体敌人"
    HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
    HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
    HELP_TEXT_ALL_ALLIES      = "全体队友"
    HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
    HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
    HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  end
end
class Game_Battler
  def can_collapse?
    return false unless dead?
    unless actor?
      return false unless sprite.battler_visible
      array = [:collapse, :boss_collapse, :instant_collapse]
      return false if array.include?(sprite.effect_type)
    end
    return true
  end
  def draw_mp?
    return true
  end
  def draw_tp?
    return $data_system.opt_display_tp
  end
end
module Icon
  def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
end
class Game_Temp
  attr_accessor :battle_aid
  attr_accessor :evaluating
end
class Game_Action
  alias evaluate_item_with_target_abe evaluate_item_with_target
  def evaluate_item_with_target(target)
    $game_temp.evaluating = true
    result = evaluate_item_with_target_abe(target)
    $game_temp.evaluating = false
    return result
  end
end
class Game_Actor < Game_Battler
  def draw_mp?
    return true unless draw_tp?
    for skill in skills
      next unless added_skill_types.include?(skill.stype_id)
      return true if skill.mp_cost > 0
    end
    return false
  end
  def draw_tp?
    return false unless $data_system.opt_display_tp
    for skill in skills
      next unless added_skill_types.include?(skill.stype_id)
      return true if skill.tp_cost > 0
    end
    return false
  end
end
class Window_BattleStatus < Window_Selectable
  def initialize
    super(0, 0, window_width, window_height)
    self.openness = 0
    self.opacity = 0
    @party = $game_party.battle_members.clone
  end
  def col_max; return $game_party.max_battle_members; end
  def battle_members; return $game_party.battle_members; end
  def actor; return battle_members[@index]; end
  def update
    super
    return if @party == $game_party.battle_members
    @party = $game_party.battle_members.clone
    refresh
  end
  def draw_item(index)
    return if index.nil?
    clear_item(index)
    actor = battle_members[index]
    rect = item_rect(index)
    return if actor.nil?
    draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
    draw_actor_name(actor, rect.x, rect.y, rect.width-8)
    draw_actor_action(actor, rect.x, rect.y)
    draw_actor_icons(actor, rect.x, line_height*1, rect.width)
    gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
    contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
    draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
    if draw_tp?(actor) && draw_mp?(actor)
      dw = rect.width/2-2
      dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
      draw_actor_tp(actor, rect.x+2, line_height*3, dw)
      dw = rect.width - rect.width/2 - 2
      draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
    elsif draw_tp?(actor) && !draw_mp?(actor)
      draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
    else
      draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
    end
  end
  def item_rect(index)
    rect = Rect.new
    rect.width = contents.width / $game_party.max_battle_members
    rect.height = contents.height
    rect.x = index * rect.width
    if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
      rect.x += (contents.width - $game_party.members.size * rect.width) / 2
    end
    rect.y = 0
    return rect
  end
  def draw_face(face_name, face_index, dx, dy, enabled = true)
    bitmap = Cache.face(face_name)
    fx = [(96 - item_rect(0).width + 1) / 2, 0].max
    fy = face_index / 4 * 96 + 2
    fw = [item_rect(0).width - 4, 92].min
    rect = Rect.new(fx, fy, fw, 92)
    rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)#这里
    contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
  def draw_actor_name(actor, dx, dy, dw = 112)
    reset_font_settings
    contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
    change_color(hp_color(actor))
    draw_text(dx+24, dy, dw-24, line_height, actor.name)
  end
  def draw_actor_action(actor, dx, dy)
    draw_icon(action_icon(actor), dx, dy)
  end
  def action_icon(actor)
    return Icon.no_action if actor.current_action.nil?
    return Icon.no_action if actor.current_action.item.nil?
    return actor.current_action.item.icon_index
  end
  def draw_tp?(actor)
    return actor.draw_tp?
  end
  def draw_mp?(actor)
    return actor.draw_mp?
  end
  def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
    change_color(color1)
    draw_text(dx, dy, dw, line_height, current.to_s, 2)
  end
  def draw_actor_hp(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
    draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
      hp_color(actor), normal_color)
    end
  def draw_actor_mp(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
    draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
      mp_color(actor), normal_color)
    end
  def draw_actor_tp(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
    change_color(tp_color(actor))
    draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  end
end
class Window_BattleActor < Window_BattleStatus
  def show
    create_flags
    super
  end
  def create_flags
    set_select_flag(:any)
    select(0)
    return if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      select(0)
      set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_user?
      battler = BattleManager.actor
      id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
      select(id)
      set_select_flag(:user)
    elsif $game_temp.battle_aid.for_all?
      select(0)
      set_select_flag(:all)
      set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_random?
      select(0)
      set_select_flag(:random) if $game_temp.battle_aid.for_random?
    end
  end
  def set_select_flag(flag)
    @select_flag = flag
    case @select_flag
    when :all, :all_dead, :random
      @cursor_all = true
    else
      @cursor_all = false
    end
  end
  def update_cursor
    if @cursor_all
      cursor_rect.set(0, 0, contents.width, contents.height)
      self.top_row = 0
    elsif @index < 0
      cursor_rect.empty
    else
      ensure_cursor_visible
      cursor_rect.set(item_rect(@index))
    end
  end
  def cursor_movable?
    return false if @select_flag == :user
    return super
  end
  def current_item_enabled?
    return true if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      member = $game_party.battle_members[@index]
      return member.dead? if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_dead_friend?
      for member in $game_party.battle_members
        return true if member.dead?
      end
      return false
    end
    return true
  end
end
class Window_BattleStatusAid < Window_BattleStatus
  attr_accessor :status_window
  def initialize
    super
    self.visible = false
    self.openness = 255
  end
  def window_width; return 128; end
  def show
    super
    refresh
  end
  def refresh
    contents.clear
    return if @status_window.nil?
    draw_item(@status_window.index)
  end
  def item_rect(index)
    return Rect.new(0, 0, contents.width, contents.height)
  end
end
class Window_BattleEnemy < Window_Selectable
  def initialize(info_viewport)
    super(0, Graphics.height, window_width, fitting_height(1))
    refresh
    self.visible = false
    @info_viewport = info_viewport
  end
  def col_max; return item_max; end
  def show
    create_flags
    super
  end
  def create_flags
    set_select_flag(:any)
    select(0)
    return if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      select(0)
    elsif $game_temp.battle_aid.for_all?
      select(0)
      set_select_flag(:all)
    elsif $game_temp.battle_aid.for_random?
      select(0)
      set_select_flag(:random)
    end
  end
  def set_select_flag(flag)
    @select_flag = flag
    case @select_flag
    when :all, :random
      @cursor_all = true
    else
      @cursor_all = false
    end
  end
  def select_all?
    return true if @select_flag == :all
    return true if @select_flag == :random
    return false
  end
  def update_cursor
    if @cursor_all
      cursor_rect.set(0, 0, contents.width, contents.height)
      self.top_row = 0
    elsif @index < 0
      cursor_rect.empty
    else
      ensure_cursor_visible
      cursor_rect.set(item_rect(@index))
    end
  end
  def cursor_movable?
    return false if @select_flag == :user
    return super
  end
  def current_item_enabled?
    return true if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      member = $game_party.battle_members[@index]
      return member.dead? if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_dead_friend?
      for member in $game_party.battle_members
        return true if member.dead?
      end
      return false
    end
    return true
  end
  def enemy; @data[index]; end
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
  def make_item_list
    @data = $game_troop.alive_members
    @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  end
  def draw_item(index); return; end
  def update
    super
    return unless active
    enemy.sprite_effect_type = :whiten
    return unless select_all?
    for enemy in $game_troop.alive_members
      enemy.sprite_effect_type = :whiten
    end
  end
end
class Window_BattleHelp < Window_Help
  attr_accessor :actor_window
  attr_accessor :enemy_window
  def update
    super
    if !self.visible and @text != ""
      @text = ""
      return refresh
    end
    update_battler_name
  end
  def update_battler_name
    return unless @actor_window.active || @enemy_window.active
    if @actor_window.active
      battler = $game_party.battle_members[@actor_window.index]
    elsif @enemy_window.active
      battler = @enemy_window.enemy
    end
    if special_display?
      refresh_special_case(battler)
    else
      refresh_battler_name(battler) if battler_name(battler) != @text
    end
  end
  def battler_name(battler)
    text = battler.name.clone
    return text
  end
  def refresh_battler_name(battler)
    contents.clear
    reset_font_settings
    change_color(normal_color)
    @text = battler_name(battler)
    icons = battler.state_icons + battler.buff_icons
    dy = icons.size <= 0 ? line_height / 2 : 0
    draw_text(0, dy, contents.width, line_height, @text, 1)
    dx = (contents.width - (icons.size * 24)) / 2
    draw_actor_icons(battler, dx, line_height, contents.width)
  end
  def special_display?
    return false if $game_temp.battle_aid.nil?
    return false if $game_temp.battle_aid.for_user?
    return !$game_temp.battle_aid.need_selection?
  end
  def refresh_special_case(battler)
    if $game_temp.battle_aid.for_opponent?
      if $game_temp.battle_aid.for_all?
        text = YEA::BATTLE::HELP_TEXT_ALL_FOES
      else
        case $game_temp.battle_aid.number_of_targets
        when 1
          text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
        else
          number = $game_temp.battle_aid.number_of_targets
          text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
        end
      end
    else
      if $game_temp.battle_aid.for_dead_friend?
        text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
      elsif $game_temp.battle_aid.for_random?
        case $game_temp.battle_aid.number_of_targets
        when 1
          text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
        else
          number = $game_temp.battle_aid.number_of_targets
          text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
        end
      else
        text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
      end
    end
    return if text == @text
    @text = text
    contents.clear
    reset_font_settings
    draw_text(0, 0, contents.width, line_height*2, @text, 1)
  end
end
class Window_SkillList < Window_Selectable
  def spacing
    return 8 if $game_party.in_battle
    return super
  end
end
class Window_ItemList < Window_Selectable
  def spacing
    return 8 if $game_party.in_battle
    return super
  end
end
class Scene_Battle < Scene_Base
  attr_accessor :enemy_window
  attr_accessor :info_viewport
  attr_accessor :spriteset
  attr_accessor :status_window
  attr_accessor :status_aid_window
  attr_accessor :subject
  alias scene_battle_create_all_windows_abe create_all_windows
  def create_all_windows
    scene_battle_create_all_windows_abe
    create_battle_status_aid_window
    set_help_window
  end
  alias scene_battle_create_info_viewport_abe create_info_viewport
  def create_info_viewport
    scene_battle_create_info_viewport_abe
    @status_window.refresh
  end
  def create_battle_status_aid_window
    @status_aid_window = Window_BattleStatusAid.new
    @status_aid_window.status_window = @status_window
    @status_aid_window.x = Graphics.width - @status_aid_window.width
    @status_aid_window.y = Graphics.height - @status_aid_window.height
  end
  def create_help_window
    @help_window = Window_BattleHelp.new
    @help_window.hide
  end
  def set_help_window
    @help_window.actor_window = @actor_window
    @help_window.enemy_window = @enemy_window
  end
  alias scene_battle_create_skill_window_abe create_skill_window
  def create_skill_window
    scene_battle_create_skill_window_abe
    @skill_window.height = @info_viewport.rect.height
    @skill_window.width = Graphics.width - @actor_command_window.width
    @skill_window.y = Graphics.height - @skill_window.height
  end
  alias scene_battle_create_item_window_abe create_item_window
  def create_item_window
    scene_battle_create_item_window_abe
    @item_window.height = @skill_window.height
    @item_window.width = @skill_window.width
    @item_window.y = Graphics.height - @item_window.height
  end
  alias scene_battle_next_command_abe next_command
  def next_command
    @status_window.show
    redraw_current_status
    @actor_command_window.show
    @status_aid_window.hide
    scene_battle_next_command_abe
  end
  alias scene_battle_prior_command_abe prior_command
  def prior_command
    redraw_current_status
    scene_battle_prior_command_abe
  end
  def redraw_current_status
    return if @status_window.index < 0
    @status_window.draw_item(@status_window.index)
  end
  alias scene_battle_command_attack_abe command_attack
  def command_attack
    $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
    scene_battle_command_attack_abe
  end
  alias scene_battle_command_skill_abe command_skill
  def command_skill
    scene_battle_command_skill_abe
    @status_window.hide
    @actor_command_window.hide
    @status_aid_window.show
  end
  alias scene_battle_command_item_abe command_item
  def command_item
    scene_battle_command_item_abe
    @status_window.hide
    @actor_command_window.hide
    @status_aid_window.show
  end
  def on_skill_ok
    @skill = @skill_window.item
    $game_temp.battle_aid = @skill
    BattleManager.actor.input.set_skill(@skill.id)
    BattleManager.actor.last_skill.object = @skill
    if @skill.for_opponent?
      select_enemy_selection
    elsif @skill.for_friend?
      select_actor_selection
    else
      @skill_window.hide
      next_command
      $game_temp.battle_aid = nil
    end
  end
  alias scene_battle_on_skill_cancel_abe on_skill_cancel
  def on_skill_cancel
    scene_battle_on_skill_cancel_abe
    @status_window.show
    @actor_command_window.show
    @status_aid_window.hide
  end
  def on_item_ok
    @item = @item_window.item
    $game_temp.battle_aid = @item
    BattleManager.actor.input.set_item(@item.id)
    if @item.for_opponent?
      select_enemy_selection
    elsif @item.for_friend?
      select_actor_selection
    else
      @item_window.hide
      next_command
      $game_temp.battle_aid = nil
    end
    $game_party.last_item.object = @item
  end
  alias scene_battle_on_item_cancel_abe on_item_cancel
  def on_item_cancel
    scene_battle_on_item_cancel_abe
    @status_window.show
    @actor_command_window.show
    @status_aid_window.hide
  end
  alias scene_battle_select_actor_selection_abe select_actor_selection
  def select_actor_selection
    @status_aid_window.refresh
    scene_battle_select_actor_selection_abe
    @status_window.hide
    @skill_window.hide
    @item_window.hide
    @help_window.show
  end
  alias scene_battle_on_actor_ok_abe on_actor_ok
  def on_actor_ok
    $game_temp.battle_aid = nil
    scene_battle_on_actor_ok_abe
    @status_window.show
    if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
      @actor_command_window.visible = !@confirm_command_window.visible
    else
      @actor_command_window.show
    end
    @status_aid_window.hide
  end
  alias scene_battle_on_actor_cancel_abe on_actor_cancel
  def on_actor_cancel
    BattleManager.actor.input.clear
    @status_aid_window.refresh
    $game_temp.battle_aid = nil
    scene_battle_on_actor_cancel_abe
    case @actor_command_window.current_symbol
    when :skill
      @skill_window.show
    when :item
      @item_window.show
    end
  end
  alias scene_battle_select_enemy_selection_abe select_enemy_selection
  def select_enemy_selection
    @status_aid_window.refresh
    scene_battle_select_enemy_selection_abe
    @help_window.show
  end
  alias scene_battle_on_enemy_ok_abe on_enemy_ok
  def on_enemy_ok
    $game_temp.battle_aid = nil
    scene_battle_on_enemy_ok_abe
  end
  alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  def on_enemy_cancel
    BattleManager.actor.input.clear
    @status_aid_window.refresh
    $game_temp.battle_aid = nil
    scene_battle_on_enemy_cancel_abe
    if @skill_window.visible || @item_window.visible
      @help_window.show
    else
      @help_window.hide
    end
  end
  def end_battle_conditions?
    return true if $game_party.members.empty?
    return true if $game_party.all_dead?
    return true if $game_troop.all_dead?
    return true if BattleManager.aborting?
    return false
  end
  def refresh_status
    #如果你是程序员,请顺手帮忙优化下这里,谢谢。
    @status_window.refresh
    for i in $game_party.battle_members
      @status_window.draw_item($game_party.battle_members.index(i))
    end
  end
end
[/pre]

[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

效果
脚本内容[pre lang="ruby"]$脸图战斗 = true
$imported = {} if $imported.nil?
module YEA
  module BATTLE
    SKIP_PARTY_COMMAND = true
    BATTLESTATUS_NAME_FONT_SIZE = 20
    BATTLESTATUS_TEXT_FONT_SIZE = 16
    BATTLESTATUS_NO_ACTION_ICON = 185
    BATTLESTATUS_HPGAUGE_Y_PLUS = 11
    BATTLESTATUS_CENTER_FACES   = false
    HELP_TEXT_ALL_FOES        = "全体敌人"
    HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
    HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
    HELP_TEXT_ALL_ALLIES      = "全体队友"
    HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
    HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
    HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  end
end
class Game_Battler
  def can_collapse?
    return false unless dead?
    unless actor?
      return false unless sprite.battler_visible
      array = [:collapse, :boss_collapse, :instant_collapse]
      return false if array.include?(sprite.effect_type)
    end
    return true
  end
  def draw_mp
    return true
  end
  def draw_tp
    return $data_system.opt_display_tp
  end
end
module Icon
  def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
end
class Game_Temp
  attr_accessor :battle_aid
  attr_accessor :evaluating
end
class Game_Action
  alias evaluate_item_with_target_abe evaluate_item_with_target
  def evaluate_item_with_target(target)
    $game_temp.evaluating = true
    result = evaluate_item_with_target_abe(target)
    $game_temp.evaluating = false
    return result
  end
end
=begin
class Game_Actor < Game_Battler
  def draw_mp?
    return true unless draw_tp?
    for skill in skills
      next unless added_skill_types.include?(skill.stype_id)
      return true if skill.mp_cost > 0
    end
    return false
  end
  def draw_tp?
    return false unless $data_system.opt_display_tp
    for skill in skills
      next unless added_skill_types.include?(skill.stype_id)
      return true if skill.tp_cost > 0
    end
    return false
  end
end
=end
class Window_BattleStatus < Window_Selectable
  def initialize
    super(0, 0, window_width, window_height)
    self.openness = 0
    self.opacity = 0
    @party = $game_party.battle_members.clone
  end
  def col_max; return $game_party.max_battle_members; end
  def battle_members; return $game_party.battle_members; end
  def actor; return battle_members[@index]; end
  def update
    super
    return if @party == $game_party.battle_members
    @party = $game_party.battle_members.clone
    refresh
  end
  def draw_item(index)
    return if index.nil?
    clear_item(index)
    actor = battle_members[index]
    rect = item_rect(index)
    return if actor.nil?
    draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
    draw_actor_name(actor, rect.x, rect.y, rect.width-8)
    draw_actor_action(actor, rect.x, rect.y)
    draw_actor_icons(actor, rect.x, line_height*1, rect.width)
    gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
    contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
    draw_actor_hp(actor, rect.x+2, line_height*1.5+gx, rect.width-4)
      dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
      draw_actor_mp(actor, rect.x+2, line_height*2+gx, rect.width-4)
      draw_actor_tp(actor, rect.x+2, line_height*2.5+gx, rect.width-4)
    end
  def item_rect(index)
    rect = Rect.new
    rect.width = contents.width / $game_party.max_battle_members
    rect.height = contents.height
    rect.x = index * rect.width
    if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
      rect.x += (contents.width - $game_party.members.size * rect.width) / 2
    end
    rect.y = 0
    return rect
  end
  def draw_face(face_name, face_index, dx, dy, enabled = true)
    bitmap = Cache.face(face_name)
    fx = [(96 - item_rect(0).width + 1) / 2, 0].max
    fy = face_index / 4 * 96 + 2
    fw = [item_rect(0).width - 4, 92].min
    rect = Rect.new(fx, fy, fw, 92)
    rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)#这里
    contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
  def draw_actor_name(actor, dx, dy, dw = 112)
    reset_font_settings
    contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
    change_color(hp_color(actor))
    draw_text(dx+24, dy, dw-24, line_height, actor.name)
  end
  def draw_actor_action(actor, dx, dy)
    draw_icon(action_icon(actor), dx, dy)
  end
  def action_icon(actor)
    return Icon.no_action if actor.current_action.nil?
    return Icon.no_action if actor.current_action.item.nil?
    return actor.current_action.item.icon_index
  end
  def draw_tp(actor)
    return actor.draw_tp
  end
  def draw_mp(actor)
    return actor.draw_mp
  end
  def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
    change_color(color1)
    draw_text(dx, dy, dw, line_height, current.to_s, 2)
  end
  def draw_actor_hp(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
    draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
      hp_color(actor), normal_color)
    end
  def draw_actor_mp(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
    draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
      mp_color(actor), normal_color)
    end
  def draw_actor_tp(actor, dx, dy, width = 124)
    draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
    change_color(system_color)
    cy = (Font.default_size - contents.font.size) / 2 + 1
    draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
    change_color(tp_color(actor))
    draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  end
end
class Window_BattleActor < Window_BattleStatus
  def show
    create_flags
    super
  end
  def create_flags
    set_select_flag(:any)
    select(0)
    return if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      select(0)
      set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_user?
      battler = BattleManager.actor
      id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
      select(id)
      set_select_flag(:user)
    elsif $game_temp.battle_aid.for_all?
      select(0)
      set_select_flag(:all)
      set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_random?
      select(0)
      set_select_flag(:random) if $game_temp.battle_aid.for_random?
    end
  end
  def set_select_flag(flag)
    @select_flag = flag
    case @select_flag
    when :all, :all_dead, :random
      @cursor_all = true
    else
      @cursor_all = false
    end
  end
  def update_cursor
    if @cursor_all
      cursor_rect.set(0, 0, contents.width, contents.height)
      self.top_row = 0
    elsif @index < 0
      cursor_rect.empty
    else
      ensure_cursor_visible
      cursor_rect.set(item_rect(@index))
    end
  end
  def cursor_movable?
    return false if @select_flag == :user
    return super
  end
  def current_item_enabled?
    return true if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      member = $game_party.battle_members[@index]
      return member.dead? if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_dead_friend?
      for member in $game_party.battle_members
        return true if member.dead?
      end
      return false
    end
    return true
  end
end
class Window_BattleStatusAid < Window_BattleStatus
  attr_accessor :status_window
  def initialize
    super
    self.visible = false
    self.openness = 255
  end
  def window_width; return 128; end
  def show
    super
    refresh
  end
  def refresh
    contents.clear
    return if @status_window.nil?
    draw_item(@status_window.index)
  end
  def item_rect(index)
    return Rect.new(0, 0, contents.width, contents.height)
  end
end
class Window_BattleEnemy < Window_Selectable
  def initialize(info_viewport)
    super(0, Graphics.height, window_width, fitting_height(1))
    refresh
    self.visible = false
    @info_viewport = info_viewport
  end
  def col_max; return item_max; end
  def show
    create_flags
    super
  end
  def create_flags
    set_select_flag(:any)
    select(0)
    return if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      select(0)
    elsif $game_temp.battle_aid.for_all?
      select(0)
      set_select_flag(:all)
    elsif $game_temp.battle_aid.for_random?
      select(0)
      set_select_flag(:random)
    end
  end
  def set_select_flag(flag)
    @select_flag = flag
    case @select_flag
    when :all, :random
      @cursor_all = true
    else
      @cursor_all = false
    end
  end
  def select_all?
    return true if @select_flag == :all
    return true if @select_flag == :random
    return false
  end
  def update_cursor
    if @cursor_all
      cursor_rect.set(0, 0, contents.width, contents.height)
      self.top_row = 0
    elsif @index < 0
      cursor_rect.empty
    else
      ensure_cursor_visible
      cursor_rect.set(item_rect(@index))
    end
  end
  def cursor_movable?
    return false if @select_flag == :user
    return super
  end
  def current_item_enabled?
    return true if $game_temp.battle_aid.nil?
    if $game_temp.battle_aid.need_selection?
      member = $game_party.battle_members[@index]
      return member.dead? if $game_temp.battle_aid.for_dead_friend?
    elsif $game_temp.battle_aid.for_dead_friend?
      for member in $game_party.battle_members
        return true if member.dead?
      end
      return false
    end
    return true
  end
  def enemy; @data[index]; end
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
  def make_item_list
    @data = $game_troop.alive_members
    @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  end
  def draw_item(index); return; end
  def update
    super
    return unless active
    enemy.sprite_effect_type = :whiten
    return unless select_all?
    for enemy in $game_troop.alive_members
      enemy.sprite_effect_type = :whiten
    end
  end
end
class Window_BattleHelp < Window_Help
  attr_accessor :actor_window
  attr_accessor :enemy_window
  def update
    super
    if !self.visible and @text != ""
      @text = ""
      return refresh
    end
    update_battler_name
  end
  def update_battler_name
    return unless @actor_window.active || @enemy_window.active
    if @actor_window.active
      battler = $game_party.battle_members[@actor_window.index]
    elsif @enemy_window.active
      battler = @enemy_window.enemy
    end
    if special_display?
      refresh_special_case(battler)
    else
      refresh_battler_name(battler) if battler_name(battler) != @text
    end
  end
  def battler_name(battler)
    text = battler.name.clone
    return text
  end
  def refresh_battler_name(battler)
    contents.clear
    reset_font_settings
    change_color(normal_color)
    @text = battler_name(battler)
    icons = battler.state_icons + battler.buff_icons
    dy = icons.size <= 0 ? line_height / 2 : 0
    draw_text(0, dy, contents.width, line_height, @text, 1)
    dx = (contents.width - (icons.size * 24)) / 2
    draw_actor_icons(battler, dx, line_height, contents.width)
  end
  def special_display?
    return false if $game_temp.battle_aid.nil?
    return false if $game_temp.battle_aid.for_user?
    return !$game_temp.battle_aid.need_selection?
  end
  def refresh_special_case(battler)
    if $game_temp.battle_aid.for_opponent?
      if $game_temp.battle_aid.for_all?
        text = YEA::BATTLE::HELP_TEXT_ALL_FOES
      else
        case $game_temp.battle_aid.number_of_targets
        when 1
          text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
        else
          number = $game_temp.battle_aid.number_of_targets
          text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
        end
      end
    else
      if $game_temp.battle_aid.for_dead_friend?
        text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
      elsif $game_temp.battle_aid.for_random?
        case $game_temp.battle_aid.number_of_targets
        when 1
          text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
        else
          number = $game_temp.battle_aid.number_of_targets
          text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
        end
      else
        text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
      end
    end
    return if text == @text
    @text = text
    contents.clear
    reset_font_settings
    draw_text(0, 0, contents.width, line_height*2, @text, 1)
  end
end
class Window_SkillList < Window_Selectable
  def spacing
    return 8 if $game_party.in_battle
    return super
  end
end
class Window_ItemList < Window_Selectable
  def spacing
    return 8 if $game_party.in_battle
    return super
  end
end
class Scene_Battle < Scene_Base
  attr_accessor :enemy_window
  attr_accessor :info_viewport
  attr_accessor :spriteset
  attr_accessor :status_window
  attr_accessor :status_aid_window
  attr_accessor :subject
  alias scene_battle_create_all_windows_abe create_all_windows
  def create_all_windows
    scene_battle_create_all_windows_abe
    create_battle_status_aid_window
    set_help_window
  end
  alias scene_battle_create_info_viewport_abe create_info_viewport
  def create_info_viewport
    scene_battle_create_info_viewport_abe
    @status_window.refresh
  end
  def create_battle_status_aid_window
    @status_aid_window = Window_BattleStatusAid.new
    @status_aid_window.status_window = @status_window
    @status_aid_window.x = Graphics.width - @status_aid_window.width
    @status_aid_window.y = Graphics.height - @status_aid_window.height
  end
  def create_help_window
    @help_window = Window_BattleHelp.new
    @help_window.hide
  end
  def set_help_window
    @help_window.actor_window = @actor_window
    @help_window.enemy_window = @enemy_window
  end
  alias scene_battle_create_skill_window_abe create_skill_window
  def create_skill_window
    scene_battle_create_skill_window_abe
    @skill_window.height = @info_viewport.rect.height
    @skill_window.width = Graphics.width - @actor_command_window.width
    @skill_window.y = Graphics.height - @skill_window.height
  end
  alias scene_battle_create_item_window_abe create_item_window
  def create_item_window
    scene_battle_create_item_window_abe
    @item_window.height = @skill_window.height
    @item_window.width = @skill_window.width
    @item_window.y = Graphics.height - @item_window.height
  end
  alias scene_battle_next_command_abe next_command
  def next_command
    @status_window.show
    redraw_current_status
    @actor_command_window.show
    @status_aid_window.hide
    scene_battle_next_command_abe
  end
  alias scene_battle_prior_command_abe prior_command
  def prior_command
    redraw_current_status
    scene_battle_prior_command_abe
  end
  def redraw_current_status
    return if @status_window.index < 0
    @status_window.draw_item(@status_window.index)
  end
  alias scene_battle_command_attack_abe command_attack
  def command_attack
    $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
    scene_battle_command_attack_abe
  end
  alias scene_battle_command_skill_abe command_skill
  def command_skill
    scene_battle_command_skill_abe
    @status_window.hide
    @actor_command_window.hide
    @status_aid_window.show
  end
  alias scene_battle_command_item_abe command_item
  def command_item
    scene_battle_command_item_abe
    @status_window.hide
    @actor_command_window.hide
    @status_aid_window.show
  end
  def on_skill_ok
    @skill = @skill_window.item
    $game_temp.battle_aid = @skill
    BattleManager.actor.input.set_skill(@skill.id)
    BattleManager.actor.last_skill.object = @skill
    if @skill.for_opponent?
      select_enemy_selection
    elsif @skill.for_friend?
      select_actor_selection
    else
      @skill_window.hide
      next_command
      $game_temp.battle_aid = nil
    end
  end
  alias scene_battle_on_skill_cancel_abe on_skill_cancel
  def on_skill_cancel
    scene_battle_on_skill_cancel_abe
    @status_window.show
    @actor_command_window.show
    @status_aid_window.hide
  end
  def on_item_ok
    @item = @item_window.item
    $game_temp.battle_aid = @item
    BattleManager.actor.input.set_item(@item.id)
    if @item.for_opponent?
      select_enemy_selection
    elsif @item.for_friend?
      select_actor_selection
    else
      @item_window.hide
      next_command
      $game_temp.battle_aid = nil
    end
    $game_party.last_item.object = @item
  end
  alias scene_battle_on_item_cancel_abe on_item_cancel
  def on_item_cancel
    scene_battle_on_item_cancel_abe
    @status_window.show
    @actor_command_window.show
    @status_aid_window.hide
  end
  alias scene_battle_select_actor_selection_abe select_actor_selection
  def select_actor_selection
    @status_aid_window.refresh
    scene_battle_select_actor_selection_abe
    @status_window.hide
    @skill_window.hide
    @item_window.hide
    @help_window.show
  end
  alias scene_battle_on_actor_ok_abe on_actor_ok
  def on_actor_ok
    $game_temp.battle_aid = nil
    scene_battle_on_actor_ok_abe
    @status_window.show
    if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
      @actor_command_window.visible = !@confirm_command_window.visible
    else
      @actor_command_window.show
    end
    @status_aid_window.hide
  end
  alias scene_battle_on_actor_cancel_abe on_actor_cancel
  def on_actor_cancel
    BattleManager.actor.input.clear
    @status_aid_window.refresh
    $game_temp.battle_aid = nil
    scene_battle_on_actor_cancel_abe
    case @actor_command_window.current_symbol
    when :skill
      @skill_window.show
    when :item
      @item_window.show
    end
  end
  alias scene_battle_select_enemy_selection_abe select_enemy_selection
  def select_enemy_selection
    @status_aid_window.refresh
    scene_battle_select_enemy_selection_abe
    @help_window.show
  end
  alias scene_battle_on_enemy_ok_abe on_enemy_ok
  def on_enemy_ok
    $game_temp.battle_aid = nil
    scene_battle_on_enemy_ok_abe
  end
  alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  def on_enemy_cancel
    BattleManager.actor.input.clear
    @status_aid_window.refresh
    $game_temp.battle_aid = nil
    scene_battle_on_enemy_cancel_abe
    if @skill_window.visible || @item_window.visible
      @help_window.show
    else
      @help_window.hide
    end
  end
  def end_battle_conditions?
    return true if $game_party.members.empty?
    return true if $game_party.all_dead?
    return true if $game_troop.all_dead?
    return true if BattleManager.aborting?
    return false
  end
  def refresh_status
    #如果你是程序员,请顺手帮忙优化下这里,谢谢。
    @status_window.refresh
    for i in $game_party.battle_members
      @status_window.draw_item($game_party.battle_members.index(i))
    end
  end
end
[/pre]

点评

效果不错啊!谢谢啦!  发表于 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.

在本版发帖返回顶部