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

Project1

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

[已经过期] 使用cp战斗系统后一使用技能菜单会消失

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
242 小时
注册时间
2013-7-16
帖子
15
跳转到指定楼层
1
发表于 2014-8-12 22:25:12 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x

就像这张图这样,右侧战斗,防御什么的都看不到了,但其实操作还能正常进行,只是看不见,这是怎么回事啊,谢谢了[code]#==============================================================================
# ■ CP制战斗系统 v1.00
#------------------------------------------------------------------------------
#    适用于:RPG Maker VX Ace
#    说明:把脚本放在Main的前面。
#    所需素材:Graphics\Pictures\SL我方.png,SL敌方.png。
#==============================================================================

#encoding:utf-8
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
#  战斗画面
#==============================================================================

class Scene_Battle < Scene_Base
  attr_accessor :cp_quota
  attr_accessor :rtab_wait
  attr_accessor :active_members
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    @cp_quota = 0
    create_spriteset
    create_all_windows
    BattleManager.method_wait_for_message = method(:wait_for_message)
  end
  #--------------------------------------------------------------------------
  # ● 战斗开始
  #--------------------------------------------------------------------------
  def battle_start
    @rtab_wait = true
    @active_members = []
    BattleManager.battle_start
    set_cp_quota
    process_event
  end
  #--------------------------------------------------------------------------
  # ● 获取敌我双方人物的平均行动速度并决定CP槽的Quota值
  #--------------------------------------------------------------------------
  def set_cp_quota
    sss = 0.0
    for iii in $game_party.members
      sss += iii.param(6)
    end
    sss /= $game_party.members.size
    @cp_quota = sss * 45
    @spriteset.cp_quota = @cp_quota
    for iii in $game_party.members + $game_troop.members
      iii.cp_quota = @cp_quota
    end
  end
  #--------------------------------------------------------------------------
  # ● 进行下一个指令输入
  #--------------------------------------------------------------------------
  def next_command
    if BattleManager.next_command
      start_actor_command_selection
    else
      turn_start(@active_members)
    end
  end
  #--------------------------------------------------------------------------
  # ● 返回上一个指令输入
  #--------------------------------------------------------------------------
  def prior_command
    if BattleManager.prior_command
      start_actor_command_selection
    else
      start_party_command_selection
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    if BattleManager.in_turn?
      process_event
      process_action
    else
      if @rtab_wait
        for iii in $game_party.members + $game_troop.members
          iii.in_turn = false
          iii.rtab_cp += iii.param(6)
          if iii.rtab_cp >= iii.cp_quota
            @active_members.push(iii)
            iii.in_turn = true
          end
        end
        if @active_members.size > 0
          @rtab_wait = false
          start_party_command_selection
        end
      end
    end
    BattleManager.judge_win_loss
  end
  #--------------------------------------------------------------------------
  # ● 回合开始
  #--------------------------------------------------------------------------
  def turn_start(members)
    @party_command_window.close
    @actor_command_window.close
    @status_window.unselect
    @subject = nil
    BattleManager.turn_start(members)
    @log_window.wait
    @log_window.clear
  end
  #--------------------------------------------------------------------------
  # ● 回合结束
  #--------------------------------------------------------------------------
  def turn_end
    @active_members.each do |battler|
      battler.on_turn_end
      refresh_status
      @log_window.display_auto_affected_status(battler)
      @log_window.wait_and_clear
    end
    BattleManager.turn_end
    process_event
    @rtab_wait = true
    @active_members = []
  end
  #--------------------------------------------------------------------------
  # ● 处理战斗行动
  #--------------------------------------------------------------------------
  def process_action
    return if scene_changing?
    if !@subject || [email protected]_action
      @subject = BattleManager.next_subject
    end
    return turn_end unless @subject
    if @subject.current_action
      @subject.current_action.prepare
      if @subject.current_action.valid?
        @status_window.open
        execute_action
      end
      @subject.remove_current_action
    end
    process_action_end unless @subject.current_action
  end
  #--------------------------------------------------------------------------
  # ● 开始队伍指令的选择
  #--------------------------------------------------------------------------
  def start_party_command_selection
    unless scene_changing?
      refresh_status
      @status_window.unselect
      @status_window.open
      if BattleManager.input_start
        BattleManager.clear_actor
        BattleManager.next_command
        @status_window.select(BattleManager.actor.index)
        @actor_command_window.setup(BattleManager.actor)
      else
        @party_command_window.deactivate
        @actor_command_window.close
        turn_start(@active_members)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成角色指令窗口
  #--------------------------------------------------------------------------
  def create_actor_command_window
    @actor_command_window = Window_ActorCommand.new
    @actor_command_window.viewport = @info_viewport
    @actor_command_window.set_handler(:attack, method(:command_attack))
    @actor_command_window.set_handler(:skill,  method(:command_skill))
    @actor_command_window.set_handler(:guard,  method(:command_guard))
    @actor_command_window.set_handler(:item,   method(:command_item))
    @actor_command_window.set_handler(:cancel, method(:prior_command))
    @actor_command_window.set_handler(:escape, method(:command_escape))
    @actor_command_window.x = Graphics.width
  end
  #--------------------------------------------------------------------------
  # ● 指令“撤退”
  #--------------------------------------------------------------------------
  def command_escape
    unless BattleManager.process_escape
      turn_start(@active_members)
      for iii in @active_members
        iii.rtab_cp = 0
      end
    end
  end
end

#encoding:utf-8
#==============================================================================
# ■ Window_ActorCommand
#------------------------------------------------------------------------------
#  战斗画面中,选择角色行动的窗口。
#==============================================================================

class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● 生成指令列表
  #--------------------------------------------------------------------------
  def make_command_list
    return unless @actor
    add_attack_command
    add_skill_commands
    add_guard_command
    add_item_command
    add_escape_command
  end
  #--------------------------------------------------------------------------
  # ● 添加撤退指令
  #--------------------------------------------------------------------------
  def add_escape_command
    add_command(Vocab::escape, :escape, BattleManager.can_escape?)
  end
end

#encoding:utf-8
#==============================================================================
# ■ BattleManager
#------------------------------------------------------------------------------
#  战斗过程的管理器。
#==============================================================================

module BattleManager
  #--------------------------------------------------------------------------
  # ● 战斗开始
  #--------------------------------------------------------------------------
  def self.battle_start
    $game_system.battle_count += 1
    $game_party.on_battle_start
    $game_troop.on_battle_start
    $game_troop.enemy_names.each do |name|
      $game_message.add(sprintf(Vocab::Emerge, name))
    end
    if @preemptive
      $game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
    elsif @surprise
      $game_message.add(sprintf(Vocab::Surprise, $game_party.name))
    end
    wait_for_message
  end
  #--------------------------------------------------------------------------
  # ● 遇敌时的处理
  #--------------------------------------------------------------------------
  def self.on_encounter
    @preemptive = false
    @surprise = false
  end
  #--------------------------------------------------------------------------
  # ● 回合开始
  #--------------------------------------------------------------------------
  def self.turn_start(members)
    @phase = :turn
    clear_actor
    $game_troop.increase_turn(members)
    make_action_orders(members)
  end
  #--------------------------------------------------------------------------
  # ● 生成行动顺序
  #--------------------------------------------------------------------------
  def self.make_action_orders(members)
    @action_battlers = []
    for iii in $game_party.members
      if members.include?(iii)
        @action_battlers.push(iii) unless @surprise
      end
    end
    for iii in $game_troop.members
      if members.include?(iii)
        @action_battlers.push(iii) unless @preemptive
      end
    end
    @action_battlers.each {|battler| battler.make_speed }
    @action_battlers.sort! {|a,b| b.speed - a.speed }
  end
end

#encoding:utf-8
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
#  处理战斗者的类。Game_Actor 和 Game_Enemy 类的父类。
#==============================================================================

class Game_Battler < Game_BattlerBase
  attr_accessor :turn_count
  attr_accessor :rtab_cp
  attr_accessor :cp_quota
  attr_accessor :in_turn
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  alias neoinitialize initialize
  def initialize
    @turn_count = 0
    @rtab_cp = 0
    @cp_quota = 100
    @in_turn = false
    neoinitialize
  end
  #--------------------------------------------------------------------------
  # ● 战斗开始处理
  #--------------------------------------------------------------------------
  def on_battle_start
    @turn_count = 0
    @rtab_cp = 0
    @cp_quota = 100
    @in_turn = false
    init_tp unless preserve_tp?
  end
  #--------------------------------------------------------------------------
  # ● 处理伤害
  #    调用前需要设置好
  #    @result.hp_damage   @result.mp_damage
  #    @result.hp_drain    @result.mp_drain
  #--------------------------------------------------------------------------
  def execute_damage(user)
    on_damage(@result.hp_damage) if @result.hp_damage > 0
    self.hp -= @result.hp_damage
    self.mp -= @result.mp_damage
    user.hp += @result.hp_drain
    user.mp += @result.mp_drain
    # 受伤后计算CP退后量
    cpback = @result.hp_damage + @result.mp_damage
    cpback = (cpback < 0 ? 0 : cpback)
    pent = 100.0 * cpback / self.mhp
    cppentback = ((5 + pent / 10) * self.cp_quota / 100).to_i
    @rtab_cp -= cppentback
    @rtab_cp = (@rtab_cp < 0 ? 0 : @rtab_cp)
  end
  #--------------------------------------------------------------------------
  # ● 判定是否可以输入指令
  #--------------------------------------------------------------------------
  def inputable?
    normal? && !auto_battle? && @in_turn
  end
  #--------------------------------------------------------------------------
  # ● 回合结束处理
  #--------------------------------------------------------------------------
  def on_turn_end
    @result.clear
    regenerate_all
    update_state_turns
    update_buff_turns
    remove_states_auto(2)
    # 该角色的回合计数加1并清空CP
    @turn_count += 1
    @rtab_cp = 0
  end
end

#encoding:utf-8
#==============================================================================
# ■ Game_Troop
#------------------------------------------------------------------------------
#  管理敌群和战斗相关资料的类,也可执行如战斗事件管理之类的功能。
#   本类的实例请参考 $game_troop 。
#==============================================================================

class Game_Troop < Game_Unit
  #--------------------------------------------------------------------------
  # ● 增加回合
  #--------------------------------------------------------------------------
  def increase_turn(members)
    troop.pages.each {|page| @event_flags

点评

应该只是坐标错了,楼主去查看一下这两个脚本 Window_BattleStatus 窗口的坐标 在里面搜索@status_window 大概就可以找到了  发表于 2014-8-12 23:32
可能是和脸图战斗的脚本冲突了,我这里单独测试这个脚本没有出现你的问题。你可以发一个范例什么的。看看  发表于 2014-8-12 23:29
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-11-14 09:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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