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

Project1

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

[已经过期] 关于脚本冲突,在下弄的不知是好,不知有没有人可以帮.....

[复制链接]

Lv2.观梦者

梦石
0
星屑
504
在线时间
43 小时
注册时间
2018-2-19
帖子
66
跳转到指定楼层
1
发表于 2018-7-22 18:35:00 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
刚才在下把一些钟意的脚本放在一起用 ,结果发生了脚本冲突 ,在下弄来弄去实在不能了 ,只好求助各位,不知能不能帮在下一个吗 ?小弟先再次感谢各位 。冲突脚本是【技能信息详细显示】和【cp战斗】。
首先是[size=18.6667px]技能信息详细显示
  1. #==============================================================================
  2. # ☆技能信息详细显示☆
  3. #------------------------------------------------------------------------------
  4. #  by -> 芯☆淡茹水
  5. #==============================================================================
  6. #  复制该脚本,插入到 main 前。
  7. #==============================================================================
  8. # 系统文字颜色
  9. SKILL_SYSTEM_COLOR = Color.new(192, 224, 255)
  10. # 技能名颜色
  11. SKILL_NAME_COLOR = Color.new(255, 128, 255)
  12. # 技能属性值颜色
  13. SKILL_RES_COLOR = Color.new(128, 255, 128)
  14. # 角色属性名称颜色
  15. SKILL_EM_COLOR = Color.new(255, 255, 128)
  16. # 技能说明颜色
  17. SKILL_TXT_COLOR = Color.new(128, 255, 255)
  18. #==============================================================================
  19. class Window_Skill_Help < Window_Base
  20.   #--------------------------------------------------------------------------
  21.   def initialize
  22.     super(396, 4, 240, 472)
  23.     self.contents = Bitmap.new(width - 32, height - 32)
  24.     self.z = 999
  25.     self.back_opacity = 220
  26.     self.visible = false
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   def set_skill(skill_id, actor_id)
  30.     self.contents.clear
  31.     if skill_id == nil or actor_id == nil
  32.       return
  33.     end
  34.     skill = $data_skills[skill_id]
  35.     actor = $game_actors[actor_id]
  36.     x = y = 0
  37.     # 技能图标
  38.     bitmap = RPG::Cache.icon(skill.icon_name)
  39.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
  40.     # 技能名
  41.     self.contents.font.color = SKILL_NAME_COLOR
  42.     self.contents.font.size = 18
  43.     cx = contents.text_size(skill.name).width
  44.     self.contents.draw_text(x + 38, y, cx, 32, skill.name)
  45.     # 技能等级
  46.     level = actor.skill_level(skill.id)
  47.     n = (level + 1) / 2
  48.     name = "l" + n.to_s
  49.     for i in 0...level
  50.       bitmap = RPG::Cache.icon(name)
  51.       self.contents.blt(x + i * 20, y + 30, bitmap, Rect.new(0, 0, 20, 20), 255)
  52.     end
  53.     # 技能类型
  54.     if [5, 6].include?(skill.scope)
  55.       name = "skill_b"
  56.     elsif skill.atk_f > 0
  57.       name = "skill_a"
  58.     elsif skill.power > 0
  59.       name = "skill_m"
  60.     elsif skill.power < 0
  61.       name = "skill_r"
  62.     else
  63.       name = "skill_o"
  64.     end
  65.     bitmap = RPG::Cache.icon(name)
  66.     self.contents.blt(self.width - 60, y + 3, bitmap, Rect.new(0, 0, 24, 24), 255)
  67.     # 熟练度
  68.     self.contents.font.color = SKILL_SYSTEM_COLOR
  69.     self.contents.font.size = 16
  70.     self.contents.draw_text(x, y + 55, 64, 28, "熟练度:")
  71.     if skill.power != 0 or skill.atk_f != 0
  72.       txt = actor.skill_proficiency[skill.id].to_s
  73.     else
  74.       txt = "——"
  75.     end
  76.     cx = contents.text_size(txt).width
  77.     self.contents.font.color = SKILL_RES_COLOR
  78.     self.contents.draw_text(x + 64, y + 55, cx, 28, txt)
  79.     self.contents.font.color = SKILL_SYSTEM_COLOR
  80.     self.contents.draw_text(x + 66 + cx, y + 55, 28, 28, "/")
  81.     if actor.skill_level(skill.id) >= 10 or (skill.power == 0 and skill.atk_f == 0)
  82.       txt = "——"
  83.     else
  84.       txt = SKILL_LEVEL[actor.skill_level(skill.id)].to_s
  85.     end
  86.     self.contents.draw_text(x + 76 + cx, y + 55, 28, 28, txt)
  87.     # 消耗 SP
  88.     y += 77
  89.     self.contents.font.color = SKILL_SYSTEM_COLOR
  90.     txt = "消耗" + $data_system.words.sp + ":"
  91.     cx = contents.text_size(txt).width
  92.     self.contents.draw_text(x, y, cx, 28, txt)
  93.     self.contents.font.color = SKILL_RES_COLOR
  94.     self.contents.draw_text(x + cx + 6, y, 96, 28, skill.sp_cost.to_s)
  95.     # 效果范围
  96.     y += 22
  97.     self.contents.font.color = SKILL_SYSTEM_COLOR
  98.     self.contents.draw_text(x, y, 94, 28, "效果范围:")
  99.     scopes = ["——。", "敌单体。", "敌全体。", "己方单体。", "己方全体。",
  100.              "己方单体(HP 0)。", "己方全体(HP 0)。", "使用者。"]
  101.     txt = scopes[skill.scope]
  102.     self.contents.font.color = SKILL_RES_COLOR
  103.     cx = contents.text_size(txt).width
  104.     self.contents.draw_text(x + 84, y, cx, 28, txt)
  105.     # 命中率
  106.     y += 32
  107.     self.contents.font.color = SKILL_SYSTEM_COLOR
  108.     self.contents.draw_text(x + 104, y, 86, 28, "命中率:")
  109.     self.contents.font.color = SKILL_RES_COLOR
  110.     self.contents.draw_text(x + 166, y, 64, 28, skill.hit.to_s + " %")
  111.     # 威力
  112.     self.contents.font.color = SKILL_SYSTEM_COLOR
  113.     self.contents.draw_text(x, y, 46, 28, "威力:")
  114.     self.contents.font.color = SKILL_RES_COLOR
  115.     txt = skill.power != 0 ? skill.power.to_s : "——"
  116.     self.contents.draw_text(x + 62, y, 64, 28, txt)
  117.     # 攻击力
  118.     y += 20
  119.     self.contents.font.color = SKILL_SYSTEM_COLOR
  120.     self.contents.draw_text(x, y, 66, 28, "攻击力:")
  121.     self.contents.font.color = SKILL_RES_COLOR
  122.     txt = skill.atk_f > 0 ? skill.atk_f.to_s : "——"
  123.     self.contents.draw_text(x + 62, y, 66, 28, txt)
  124.     # 属性相关
  125.     y += 28
  126.     self.contents.font.color = SKILL_SYSTEM_COLOR
  127.     self.contents.draw_text(x, y, 124, 28, "角色属性关联:")
  128.     names = [$data_system.words.str + ":", $data_system.words.dex + ":",
  129.             $data_system.words.agi + ":", $data_system.words.int + ":"]
  130.     elementes = [skill.str_f, skill.dex_f, skill.agi_f, skill.int_f]
  131.     text = [skill.str_f.to_s + " %", skill.dex_f.to_s + " %",
  132.           skill.agi_f.to_s + " %", skill.int_f.to_s + " %"]
  133.     bitnames = ["str_s", "dex_s","agi_s","int_s"]
  134.     for i in 0...names.size
  135.       next if elementes[i] == 0
  136.       y += 30
  137.       name = names[i]
  138.       self.contents.font.size = 16
  139.       self.contents.font.color = SKILL_EM_COLOR
  140.       cx = contents.text_size(name).width
  141.       self.contents.draw_text(x, y, cx, 28, name)
  142.       name = bitnames[i]
  143.       bitmap = RPG::Cache.icon(name)
  144.       width = bitmap.width * elementes[i] / 100
  145.       rect = Rect.new(0, 0, width, bitmap.height)
  146.       self.contents.blt(x + cx + 3, y + 8, bitmap, rect, 255)
  147.       bitmap = RPG::Cache.icon("e0")
  148.       rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  149.       self.contents.blt(x + cx + 2, y + 6, bitmap, rect, 255)
  150.       self.contents.font.size = 14
  151.       self.contents.font.color = SKILL_RES_COLOR
  152.       self.contents.draw_text(x + 110 + cx, y, 64, 28, text[i])
  153.     end
  154.     self.contents.font.size = 16
  155.     # 属性攻击
  156.     if skill.element_set != []
  157.       y += 30
  158.       self.contents.font.color = SKILL_SYSTEM_COLOR
  159.       self.contents.draw_text(x, y, 86, 28, "属性攻击:")
  160.       self.contents.font.color = SKILL_RES_COLOR
  161.       self.contents.font.size = 14
  162.       nx = 80
  163.       for i in 0...skill.element_set.size
  164.         name = $data_system.elements[skill.element_set[i]]
  165.         name = i == (skill.element_set.size - 1) ? name : name + ","
  166.         cx = contents.text_size(name).width
  167.         if nx + cx > self.width - 32
  168.           nx = 80
  169.           y += 16
  170.         end
  171.         self.contents.draw_text(nx, y, cx, 28, name)
  172.         nx += cx
  173.       end
  174.     else
  175.       y += 10
  176.     end
  177.     # 附加状态
  178.     self.contents.font.size = 16
  179.     if skill.plus_state_set != []
  180.       y += 20
  181.       self.contents.font.color = SKILL_SYSTEM_COLOR
  182.       self.contents.draw_text(x, y, 86, 28, "附加状态:")
  183.       self.contents.font.color = SKILL_RES_COLOR
  184.       nx = 80
  185.       self.contents.font.size = 14
  186.       for i in 0...skill.plus_state_set.size
  187.         name = $data_states[skill.plus_state_set[i]].name
  188.         name = i == (skill.plus_state_set.size - 1) ? name : name + ","
  189.         cx = contents.text_size(name).width
  190.         if nx + cx > self.width - 32
  191.           nx = 80
  192.           y += 16
  193.         end
  194.         self.contents.draw_text(nx, y, cx, 28, name)
  195.         nx += cx
  196.       end
  197.     end
  198.     # 解除状态
  199.     self.contents.font.size = 16
  200.     if skill.minus_state_set != []
  201.       y += 20
  202.       self.contents.font.color = SKILL_SYSTEM_COLOR
  203.       self.contents.draw_text(x, y, 86, 28, "解除状态:")
  204.       self.contents.font.color = SKILL_RES_COLOR
  205.       nx = 80
  206.       self.contents.font.size = 14
  207.       for i in 0...skill.minus_state_set.size
  208.         name = $data_states[skill.minus_state_set[i]].name
  209.         name = i == (skill.minus_state_set.size - 1) ? name : name + ","
  210.         cx = contents.text_size(name).width
  211.         if nx + cx > self.width - 32
  212.           nx = 80
  213.           y += 16
  214.         end
  215.         self.contents.draw_text(nx, y, cx, 28, name)
  216.         nx += cx
  217.       end
  218.     end
  219.     # 说明
  220.     self.contents.font.size = 16
  221.     x = 14
  222.     y += 30
  223.     self.contents.font.size = 14
  224.     self.contents.font.color = SKILL_TXT_COLOR
  225.     text = skill.description.scan(/./)
  226.     for i in 0...text.size
  227.       txt = text[i]
  228.       cx = contents.text_size(txt).width
  229.       if (x + cx) > self.width - 32
  230.         x = 0
  231.         y += 16
  232.         break if (y + 16) > self.height - 32
  233.       end
  234.       self.contents.draw_text(x, y, cx, 16, txt)
  235.       x += cx
  236.     end
  237.     self.height  = [y + 48, 472].min
  238.   end
  239. end
  240. #=============================================================================
  241. class Window_Skill < Window_Selectable
  242.   #--------------------------------------------------------------------------
  243.   # ● 初始化对像
  244.   #     actor : 角色
  245.   #--------------------------------------------------------------------------
  246.   def initialize(actor)
  247.     super(0, 64, 640, 416)
  248.     @actor = actor
  249.     @column_max = 2
  250.     refresh
  251.     self.index = 0
  252.     # 战斗中的情况下将窗口移至中央并将其半透明化
  253.     if $game_temp.in_battle
  254.       self.y = 0
  255.       self.height = 320
  256.       self.back_opacity = 160
  257.     end
  258.   end
  259. end
  260. #==============================================================================
  261. class Window_SkillStatus < Window_Base
  262.   #--------------------------------------------------------------------------
  263.   # ● 初始化对像
  264.   #     actor : 角色
  265.   #--------------------------------------------------------------------------
  266.   def initialize(actor)
  267.     super(0, 0, 640, 64)
  268.     self.contents = Bitmap.new(width - 32, height - 32)
  269.     @actor = actor
  270.     refresh
  271.   end
  272. end
  273. #=============================================================================
  274. class Scene_Skill
  275.   #--------------------------------------------------------------------------
  276.   def main
  277.     # 获取角色
  278.     @actor = $game_party.actors[@actor_index]
  279.     # 生成帮助窗口、状态窗口、特技窗口
  280.     @help_window = Window_Skill_Help.new
  281.     @status_window = Window_SkillStatus.new(@actor)
  282.     @skill_window = Window_Skill.new(@actor)
  283.     # 生成目标窗口 (设置为不可见・不活动)
  284.     @target_window = Window_Target.new
  285.     @target_window.visible = false
  286.     @target_window.active = false
  287.     # 执行过渡
  288.     Graphics.transition
  289.     # 主循环
  290.     loop do
  291.       # 刷新游戏画面
  292.       Graphics.update
  293.       # 刷新输入信息
  294.       Input.update
  295.       # 刷新画面
  296.       update
  297.       # 如果画面切换的话就中断循环
  298.       if $scene != self
  299.         break
  300.       end
  301.     end
  302.     # 准备过渡
  303.     Graphics.freeze
  304.     # 释放窗口
  305.     @help_window.dispose
  306.     @status_window.dispose
  307.     @skill_window.dispose
  308.     @target_window.dispose
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   alias add_update_skill_xdrs update_skill
  312.   def update_skill
  313.     @help_window.x = (@skill_window.index + 1) % 2 * 392 + 4
  314.     @help_window.set_skill(@skill_window.skill.id, @actor.id)
  315.     @help_window.visible = true
  316.     add_update_skill_xdrs
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   alias add_update_target_xdrs update_target
  320.   def update_target
  321.     @help_window.visible = false
  322.     add_update_target_xdrs
  323.   end
  324. end
  325. #============================================================================
  326. class Scene_Battle
  327.   #--------------------------------------------------------------------------
  328.   # ● 主处理
  329.   #--------------------------------------------------------------------------
  330.   def main
  331.     # 初始化战斗用的各种暂时数据
  332.     $game_temp.in_battle = true
  333.     $game_temp.battle_turn = 0
  334.     $game_temp.battle_event_flags.clear
  335.     $game_temp.battle_abort = false
  336.     $game_temp.battle_main_phase = false
  337.     $game_temp.battleback_name = $game_map.battleback_name
  338.     $game_temp.forcing_battler = nil
  339.     # 初始化战斗用事件解释器
  340.     $game_system.battle_interpreter.setup(nil, 0)
  341.     # 准备队伍
  342.     @troop_id = $game_temp.battle_troop_id
  343.     $game_troop.setup(@troop_id)
  344.     # 生成角色命令窗口
  345.     s1 = $data_system.words.attack
  346.     s2 = $data_system.words.skill
  347.     s3 = $data_system.words.guard
  348.     s4 = $data_system.words.item
  349.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
  350.     @actor_command_window.y = 160
  351.     @actor_command_window.back_opacity = 160
  352.     @actor_command_window.active = false
  353.     @actor_command_window.visible = false
  354.     # 生成其它窗口
  355.     @party_command_window = Window_PartyCommand.new
  356.     @help_window = Window_Help.new
  357.     @help_window.back_opacity = 160
  358.     @help_window.visible = false
  359.     @status_window = Window_BattleStatus.new
  360.     @message_window = Window_Message.new
  361.     @skill_help_window = Window_Skill_Help.new
  362.     # 生成活动块
  363.     @spriteset = Spriteset_Battle.new
  364.     # 初始化等待计数
  365.     @wait_count = 0
  366.     # 执行过渡
  367.     if $data_system.battle_transition == ""
  368.       Graphics.transition(20)
  369.     else
  370.       Graphics.transition(40, "Graphics/Transitions/" +
  371.         $data_system.battle_transition)
  372.     end
  373.     # 开始自由战斗回合
  374.     start_phase1
  375.     # 主循环
  376.     loop do
  377.       # 刷新游戏画面
  378.       Graphics.update
  379.       # 刷新输入信息
  380.       Input.update
  381.       # 刷新画面
  382.       update
  383.       # 如果画面切换的话就中断循环
  384.       if $scene != self
  385.         break
  386.       end
  387.     end
  388.     # 刷新地图
  389.     $game_map.refresh
  390.     # 准备过渡
  391.     Graphics.freeze
  392.     # 释放窗口
  393.     @actor_command_window.dispose
  394.     @party_command_window.dispose
  395.     @help_window.dispose
  396.     @status_window.dispose
  397.     @message_window.dispose
  398.     @skill_help_window.dispose
  399.     if @skill_window != nil
  400.       @skill_window.dispose
  401.     end
  402.     if @item_window != nil
  403.       @item_window.dispose
  404.     end
  405.     if @result_window != nil
  406.       @result_window.dispose
  407.     end
  408.     # 释放活动块
  409.     @spriteset.dispose
  410.     # 标题画面切换中的情况
  411.     if $scene.is_a?(Scene_Title)
  412.       # 淡入淡出画面
  413.       Graphics.transition
  414.       Graphics.freeze
  415.     end
  416.     # 战斗测试或者游戏结束以外的画面切换中的情况
  417.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  418.       $scene = nil
  419.     end
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   alias add_update_phase3_skill_select_xdrs update_phase3_skill_select
  423.   def update_phase3_skill_select
  424.     @help_window.visible = false
  425.     @skill_help_window.x = (@skill_window.index + 1) % 2 * 392 + 4
  426.     @skill_help_window.set_skill(@skill_window.skill.id, @active_battler.id)
  427.     @skill_help_window.visible = true
  428.     add_update_phase3_skill_select_xdrs
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   def start_skill_select
  432.     # 生成特技窗口
  433.     @skill_window = Window_Skill.new(@active_battler)
  434.     # 无效化角色指令窗口
  435.     @actor_command_window.active = false
  436.     @actor_command_window.visible = false
  437.   end
  438.    #--------------------------------------------------------------------------
  439.   alias add_start_enemy_select_xdrs start_enemy_select
  440.   def start_enemy_select
  441.     @skill_help_window.visible = false
  442.     add_start_enemy_select_xdrs
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   alias add_end_enemy_select_xdrs end_enemy_select
  446.   def end_enemy_select
  447.     @help_window.visible = false
  448.     add_end_enemy_select_xdrs
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   alias add_start_actor_select_xdrs start_actor_select
  452.   def start_actor_select
  453.     @skill_help_window.visible = false
  454.     add_start_actor_select_xdrs
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   alias add_end_actor_select_xdrs end_actor_select
  458.   def end_actor_select
  459.     @help_window.visible = false
  460.     add_end_actor_select_xdrs
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   alias add_end_skill_select_xdrs end_skill_select
  464.   def end_skill_select
  465.     @skill_help_window.visible = false
  466.     add_end_skill_select_xdrs
  467.   end
  468. end
  469. #=============================================================================
复制代码

[size=18.6667px]之后是cp战斗

  1. #========================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #========================================================================
  4. #========================================================================
  5. # ▼▲▼ XRXS_BP 1. CP制導入 ver..23 ▼▲▼
  6. # by 桜雅 在土, 和希
  7. #------------------------------------------------------------------------
  8. # □ カスタマイズポイント
  9. #========================================================================
  10. module XRXS_BP1
  11.   #
  12.   # 对齐方式。0:左 1:中央 2:右
  13.   #
  14.   ALIGN = 0
  15.   #
  16.   # 人数
  17.   #
  18.   MAX = 4
  19. end
  20. class Scene_Battle_CP
  21.   #
  22.   # 战斗速度
  23.   #
  24.   BATTLE_SPEED = 2.0
  25.   #
  26.   # 战斗开始的时候气槽百分比
  27.   #
  28.   START_CP_PERCENT = 0
  29. end
  30. class Scene_Battle
  31.   # 效果音效,可以自己添加
  32.   DATA_SYSTEM_COMMAND_UP_SE = ""
  33.   # 各项数值功能消耗的CP值
  34.   CP_COST_BASIC_ACTIONS = 0 # 基础共同
  35.   CP_COST_SKILL_ACTION = 65535 # 技能
  36.   CP_COST_ITEM_ACTION = 65535 # 物品
  37.   CP_COST_BASIC_ATTACK = 65535 # 攻撃
  38.   CP_COST_BASIC_GUARD = 32768 # 防御
  39.   CP_COST_BASIC_NOTHING = 65535 # 不做任何事情
  40.   CP_COST_BASIC_ESCAPE = 65535 # 逃跑
  41. end
  42. #========================================================================
  43. # --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
  44. #------------------------------------------------------------------------
  45. # Window_Commandクラスに add_command メソッドを追加します。
  46. #========================================================================
  47. module XRXS_Window_Command_Add_Command
  48.   #----------------------------------------------------------------------
  49.   # ○ コマンドを追加
  50.   #----------------------------------------------------------------------
  51.   def add_command(command)
  52.     # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  53.     #
  54.     if @disabled == nil
  55.       @disabled = []
  56.     end
  57.     if @commands.size != @disabled.size
  58.       for i in [email protected]
  59.         @disabled[i] = false
  60.       end
  61.     end
  62.     #
  63.     # 追加
  64.     #
  65.     @commands.push(command)
  66.     @disabled.push(false)
  67.     @item_max = @commands.size
  68.     self.y -= 32
  69.     self.height += 32
  70.     self.contents.dispose
  71.     self.contents = nil
  72.     self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  73.     refresh
  74.     for i in [email protected]
  75.       if @disabled[i]
  76.         disable_item(i)
  77.       end
  78.     end
  79.   end
  80.   #----------------------------------------------------------------------
  81.   # ○ 項目の無効化
  82.   # index : 項目番号
  83.   #----------------------------------------------------------------------
  84.   def disable_item(index)
  85.     if @disabled == nil
  86.       @disabled = []
  87.     end
  88.     @disabled[index] = true
  89.     draw_item(index, disabled_color)
  90.   end
  91. end
  92. class Window_Command < Window_Selectable
  93.   #----------------------------------------------------------------------
  94.   # ○ インクルード
  95.   #----------------------------------------------------------------------
  96.   include XRXS_Window_Command_Add_Command
  97.   #----------------------------------------------------------------------
  98.   # ● 項目の無効化
  99.   # index : 項目番号
  100.   #----------------------------------------------------------------------
  101.   def disable_item(index)
  102.     super
  103.   end
  104. end
  105. #========================================================================
  106. # □ Scene_Battle_CP
  107. #========================================================================
  108. class Scene_Battle_CP
  109.   #----------------------------------------------------------------------
  110.   # ○ 公開インスタンス変数
  111.   #----------------------------------------------------------------------
  112.   attr_accessor :stop # CP加算ストップ
  113.   #----------------------------------------------------------------------
  114.   # ○ オブジェクトの初期化
  115.   #----------------------------------------------------------------------
  116.   def initialize
  117.     @battlers = []
  118.     @cancel = false
  119.     @stop = false
  120.     @agi_total = 0
  121.     # 配列 count_battlers を初期化
  122.     count_battlers = []
  123.     # エネミーを配列 count_battlers に追加
  124.     for enemy in $game_troop.enemies
  125.       count_battlers.push(enemy)
  126.     end
  127.     # アクターを配列 count_battlers に追加
  128.     for actor in $game_party.actors
  129.       count_battlers.push(actor)
  130.     end
  131.     for battler in count_battlers
  132.       @agi_total += battler.agi
  133.     end
  134.     for battler in count_battlers
  135.       battler.cp = [[65535 * START_CP_PERCENT * (rand(15) + 85) * 4 * battler.agi / @agi_total / 10000, 0].max, 65535].min
  136.     end
  137.   end
  138.   #----------------------------------------------------------------------
  139.   # ○ CPカウントアップ
  140.   #----------------------------------------------------------------------
  141.   def update
  142.     # ストップされているならリターン
  143.     return if @stop
  144.     #
  145.     for battler in $game_party.actors + $game_troop.enemies
  146.       # 行動出来なければ無視
  147.       if battler.dead? == true
  148.         battler.cp = 0
  149.         next
  150.       end
  151.       battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
  152.     end
  153.   end
  154.   #----------------------------------------------------------------------
  155.   # ○ CPカウントの開始
  156.   #----------------------------------------------------------------------
  157.   def stop
  158.     @cancel = true
  159.     if @cp_thread != nil then
  160.       @cp_thread.join
  161.       @cp_thread = nil
  162.     end
  163.   end
  164. end
  165. #========================================================================
  166. # ■ Game_Battler
  167. #========================================================================
  168. class Game_Battler
  169.   attr_accessor :now_guarding # 現在防御中フラグ
  170.   attr_accessor :cp # 現在CP
  171.   attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  172.   #----------------------------------------------------------------------
  173.   # ○ CP の変更
  174.   #-----------------------------------------------------------------------
  175.   def cp=(p)
  176.     @cp = [[p, 0].max, 65535].min
  177.   end
  178.   #----------------------------------------------------------------------
  179.   # ● 防御中判定 [ 再定義 ]
  180.   #----------------------------------------------------------------------
  181.   def guarding?
  182.     return @now_guarding
  183.   end
  184.   #----------------------------------------------------------------------
  185.   # ● コマンド入力可能判定
  186.   #----------------------------------------------------------------------
  187.   alias xrxs_bp1_inputable? inputable?
  188.   def inputable?
  189.     bool = xrxs_bp1_inputable?
  190.     return (bool and (@cp >= 65535))
  191.   end
  192.   #----------------------------------------------------------------------
  193.   # ● ステート [スリップダメージ] 判定
  194.   #----------------------------------------------------------------------
  195.   alias xrxs_bp1_slip_damage? slip_damage?
  196.   def slip_damage?
  197.     return false if @slip_state_update_ban
  198.     return xrxs_bp1_slip_damage?
  199.   end
  200.   #----------------------------------------------------------------------
  201.   # ● ステート自然解除 (ターンごとに呼び出し)
  202.   #----------------------------------------------------------------------
  203.   alias xrxs_bp1_remove_states_auto remove_states_auto
  204.   def remove_states_auto
  205.     return if @slip_state_update_ban
  206.     xrxs_bp1_remove_states_auto
  207.   end
  208. end
  209. #========================================================================
  210. # ■ Game_Actor
  211. #========================================================================
  212. class Game_Actor < Game_Battler
  213.   #----------------------------------------------------------------------
  214.   # ● セットアップ
  215.   #----------------------------------------------------------------------
  216.   alias xrxs_bp1_setup setup
  217.   def setup(actor_id)
  218.     xrxs_bp1_setup(actor_id)
  219.     @cp = 0
  220.     @now_guarding = false
  221.     @slip_state_update_ban = false
  222.   end
  223. end
  224. #========================================================================
  225. # ■ Game_Enemy
  226. #========================================================================
  227. class Game_Enemy < Game_Battler
  228.   #----------------------------------------------------------------------
  229.   # ● オブジェクト初期化
  230.   #----------------------------------------------------------------------
  231.   alias xrxs_bp1_initialize initialize
  232.   def initialize(troop_id, member_index)
  233.     xrxs_bp1_initialize(troop_id, member_index)
  234.     @cp = 0
  235.     @now_guarding = false
  236.     @slip_state_update_ban = false
  237.   end
  238. end
  239. class Window_All < Window_Base
  240.   def initialize(viewport)
  241.     super(0,0,640,480)
  242.     @viewport = viewport
  243.     self.opacity = 0
  244.     self.contents = Bitmap.new(width - 32, height - 32)
  245.     @cps = nil
  246.     refresh
  247.   end
  248.   def dispose
  249.     super
  250.     dispose_cps
  251.   end
  252.   def dispose_cps
  253.     return if @cps.nil?
  254.     return if @cps.size <= 0
  255.     @cps.each{|cp| cp.dispose unless cp.nil?}
  256.   end
  257.   def alive_size
  258.     size = 0; $game_troop.enemies.each{|enemy| size += 1 if enemy.exist?}
  259.     return size
  260.   end
  261.   def refresh
  262.     if @cps.nil? || @cps.size != alive_size
  263.       create_cps
  264.     else
  265.       refresh_cps
  266.     end
  267.   end
  268.   def create_cps
  269.     dispose_cps
  270.     @cps = []
  271.     for i in 0...$game_troop.enemies.size
  272.       enemy = $game_troop.enemies[i]
  273.       next if !enemy.exist?
  274.       @cps[i] = Enemy_CP_Hito.new(enemy, @viewport)
  275.     end
  276.   end
  277.   def refresh_cps
  278.     return if @cps.nil?
  279.     return if @cps.size <= 0
  280.     @cps.each{|cp| cp.refresh}
  281.   end
  282. end
  283. class Enemy_CP_Hito < Window_Base
  284.   def initialize(enemy, viewport)
  285.     @enemy = enemy
  286.     super(enemy_x,enemy_y,cp_width + 32,cp_height + 32, viewport)
  287.     self.opacity = 0
  288.     self.contents = Bitmap.new(width - 32, height - 32)
  289.     self.z = enemy_z
  290.     refresh
  291.   end
  292.   def cp_width; return 60; end
  293.   def cp_height; return 6; end
  294.   def enemy_x; return 0 if @enemy.nil?; return @enemy.screen_x - 50; end
  295.   def enemy_y; return 0 if @enemy.nil?; return @enemy.screen_y - 25; end
  296.   def enemy_z; return 0 if @enemy.nil?; return @enemy.screen_z; end
  297.   def refresh(enemy = @enemy)
  298.     self.contents.clear
  299.     @enemy = enemy
  300.     draw_actor_cp_meter(@enemy, 0, 0, cp_width, cp_height)
  301.   end
  302.   #----------------------------------------------------------------------
  303.   # ○ CPメーター の描画
  304.   #----------------------------------------------------------------------
  305.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  306.     self.contents.font.color = system_color
  307.     self.contents.fill_rect(x, y, width,6, Color.new(0, 0, 0, 255))
  308.     if actor.cp == nil
  309.       actor.cp = 0
  310.     end
  311.     w = (width - 2) * [actor.cp,65535].min / 65535
  312.     self.contents.fill_rect(x+1, y+1, w,1, Color.new(255, 255, 128, 255))
  313.     self.contents.fill_rect(x+1, y+2, w,1, Color.new(255, 255, 0, 255))
  314.     self.contents.fill_rect(x+1, y+3, w,1, Color.new(192, 192, 0, 255))
  315.     self.contents.fill_rect(x+1, y+4, w,1, Color.new(128, 128, 0, 255))
  316.   end
  317. end
  318. class Window_Base < Window
  319.   #--------------------------------------------------------------------------
  320.   # ● 初始化对像
  321.   #     x      : 窗口的 X 坐标
  322.   #     y      : 窗口的 Y 坐标
  323.   #     width  : 窗口的宽
  324.   #     height : 窗口的宽
  325.   #--------------------------------------------------------------------------
  326.   def initialize(x, y, width, height, viewport = nil)
  327.     if viewport.nil?
  328.       super()
  329.     else
  330.       super(viewport)
  331.     end
  332.     @windowskin_name = $game_system.windowskin_name
  333.     self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  334.     self.x = x
  335.     self.y = y
  336.     self.width = width
  337.     self.height = height
  338.     self.z = 100
  339.   end
  340. end



  341. #========================================================================
  342. # ■ Window_BattleStatus
  343. #========================================================================
  344. class Window_BattleStatus < Window_Base
  345.   #-----------------------------------------------------------------------
  346.   # ○ 公開インスタンス変数
  347.   #----------------------------------------------------------------------
  348.   attr_accessor :update_cp_only # CPメーターのみの更新
  349.   #----------------------------------------------------------------------
  350.   # ● オブジェクト初期化
  351.   #----------------------------------------------------------------------
  352.   alias xrxs_bp1_initialize initialize
  353.   def initialize(enemy_viewport)
  354.     @update_cp_only = false
  355.     @wall = Window_All.new(enemy_viewport)
  356.     xrxs_bp1_initialize
  357.   end
  358.   def dispose
  359.     super
  360.     @wall.dispose
  361.   end
  362.   #----------------------------------------------------------------------
  363.   # ● リフレッシュ
  364.   #----------------------------------------------------------------------
  365.   alias xrxs_bp1_refresh refresh
  366.   def refresh
  367.     unless @update_cp_only
  368.       xrxs_bp1_refresh
  369.     end
  370.     refresh_cp
  371.     @wall.refresh
  372.   end
  373.   #----------------------------------------------------------------------
  374.   # ○ リフレッシュ(CPのみ)
  375.   #----------------------------------------------------------------------
  376.   def refresh_cp
  377.     for i in 0...$game_party.actors.size
  378.       actor = $game_party.actors[i]
  379.       width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
  380.       space = self.width / XRXS_BP1::MAX
  381.       case XRXS_BP1::ALIGN
  382.       when 0
  383.         actor_x = i * space + 4
  384.       when 1
  385.         actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
  386.       when 2
  387.         actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
  388.       end
  389.       actor_x += self.x
  390.       draw_actor_cp_meter(actor, actor_x, 96, width, 0)
  391.     end
  392.   end
  393.   #----------------------------------------------------------------------
  394.   # ○ CPメーター の描画
  395.   #----------------------------------------------------------------------
  396.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  397.     self.contents.font.color = system_color
  398.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  399.     if actor.cp == nil
  400.       actor.cp = 0
  401.     end
  402.     w = width * [actor.cp,65535].min / 65535
  403.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  404.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  405.     self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  406.     self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  407.   end
  408. end
  409. #========================================================================
  410. # ■ Scene_Battle
  411. #========================================================================
  412. class Scene_Battle
  413. ################################################
  414.   #--------------------------------------------------------------------------
  415.   # ● 主处理
  416.   #--------------------------------------------------------------------------
  417.   def main
  418.     # 初始化战斗用的各种暂时数据
  419.     $game_temp.in_battle = true
  420.     $game_temp.battle_turn = 0
  421.     $game_temp.battle_event_flags.clear
  422.     $game_temp.battle_abort = false
  423.     $game_temp.battle_main_phase = false
  424.     $game_temp.battleback_name = $game_map.battleback_name
  425.     $game_temp.forcing_battler = nil
  426.     # 初始化战斗用事件解释器
  427.     $game_system.battle_interpreter.setup(nil, 0)
  428.     # 准备队伍
  429.     @troop_id = $game_temp.battle_troop_id
  430.     $game_troop.setup(@troop_id)
  431.     # 生成角色命令窗口
  432.     s1 = $data_system.words.attack
  433.     s2 = $data_system.words.skill
  434.     s3 = $data_system.words.guard
  435.     s4 = $data_system.words.item
  436.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
  437.     @actor_command_window.y = 160
  438.     @actor_command_window.back_opacity = 160
  439.     @actor_command_window.active = false
  440.     @actor_command_window.visible = false
  441.     # 生成其它窗口
  442.     @party_command_window = Window_PartyCommand.new
  443.     @help_window = Window_Help.new
  444.     @help_window.back_opacity = 160
  445.     @help_window.visible = false
  446. ################
  447. # 活动块放到状态窗口之上生成
  448.     # 生成活动块
  449.     @spriteset = Spriteset_Battle.new
  450. # 加括弧里的内容
  451.     @status_window = Window_BattleStatus.new(@spriteset.viewport1)
  452. ################
  453.     @message_window = Window_Message.new
  454.     # 初始化等待计数
  455.     @wait_count = 0
  456.     # 执行过渡
  457.     if $data_system.battle_transition == ""
  458.       Graphics.transition(20)
  459.     else
  460.       Graphics.transition(40, "Graphics/Transitions/" +
  461.         $data_system.battle_transition)
  462.     end
  463.     # 开始自由战斗回合
  464.     start_phase1
  465.     # 主循环
  466.     loop do
  467.       # 刷新游戏画面
  468.       Graphics.update
  469.       # 刷新输入信息
  470.       Input.update
  471.       # 刷新画面
  472.       update
  473.       # 如果画面切换的话就中断循环
  474.       if $scene != self
  475.         break
  476.       end
  477.     end
  478.     # 刷新地图
  479.     $game_map.refresh
  480.     # 准备过渡
  481.     Graphics.freeze
  482.     # 释放窗口
  483.     @actor_command_window.dispose
  484.     @party_command_window.dispose
  485.     @help_window.dispose
  486.     @status_window.dispose
  487.     @message_window.dispose
  488.     if @skill_window != nil
  489.       @skill_window.dispose
  490.     end
  491.     if @item_window != nil
  492.       @item_window.dispose
  493.     end
  494.     if @result_window != nil
  495.       @result_window.dispose
  496.     end
  497.     # 释放活动块
  498.     @spriteset.dispose
  499.     # 标题画面切换中的情况
  500.     if $scene.is_a?(Scene_Title)
  501.       # 淡入淡出画面
  502.       Graphics.transition
  503.       Graphics.freeze
  504.     end
  505.     # 战斗测试或者游戏结束以外的画面切换中的情况
  506.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  507.       $scene = nil
  508.     end
  509.   end
  510. ################################################
  511.   #----------------------------------------------------------------------
  512.   # ● フレーム更新
  513.   #----------------------------------------------------------------------
  514.   alias xrxs_bp1_update update
  515.   def update
  516.     xrxs_bp1_update
  517.     # CP更新
  518.     @cp_thread.update
  519.   end
  520.   #----------------------------------------------------------------------
  521.   # ● バトル終了
  522.   # result : 結果 (0:勝利 1:敗北 2:逃走)
  523.   #----------------------------------------------------------------------
  524.   alias xrxs_bp1_battle_end battle_end
  525.   def battle_end(result)
  526.     # CPカウントを停止する
  527.     @cp_thread.stop
  528.     # 呼び戻す
  529.     xrxs_bp1_battle_end(result)
  530.   end
  531.   #----------------------------------------------------------------------
  532.   # ● プレバトルフェーズ開始
  533.   #----------------------------------------------------------------------
  534.   alias xrxs_bp1_start_phase1 start_phase1
  535.   def start_phase1
  536.     @agi_total = 0
  537.     # CP加算を開始する
  538.     @cp_thread = Scene_Battle_CP.new
  539.     # インデックスを計算
  540.     @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  541.     # アクターコマンドウィンドウに追加
  542.     @actor_command_window.add_command("逃跑")
  543.     if !$game_temp.battle_can_escape
  544.       @actor_command_window.disable_item(@cp_escape_actor_command_index)
  545.     end
  546.     # 呼び戻す
  547.     xrxs_bp1_start_phase1
  548.   end
  549.   #----------------------------------------------------------------------
  550.   # ● パーティコマンドフェーズ開始
  551.   #----------------------------------------------------------------------
  552.   alias xrxs_bp1_start_phase2 start_phase2
  553.   def start_phase2
  554.     xrxs_bp1_start_phase2
  555.     @party_command_window.active = false
  556.     @party_command_window.visible = false
  557.     # CP加算を再開する
  558.     @cp_thread.stop = false
  559.     # 次へ
  560.     start_phase3
  561.   end
  562.   #----------------------------------------------------------------------
  563.   # ● アクターコマンドウィンドウのセットアップ
  564.   #----------------------------------------------------------------------
  565.   alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  566.   def phase3_setup_command_window
  567.     # CPスレッドを一時停止する
  568.     @cp_thread.stop = true
  569.     # ウィンドウのCP更新
  570.     @status_window.refresh_cp
  571.     # @active_battlerの防御を解除
  572.     @active_battler.now_guarding = false
  573.     # 効果音の再生
  574.     Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  575.     # 呼び戻す
  576.     xrxs_bp1_phase3_setup_command_window
  577.   end
  578.   #----------------------------------------------------------------------
  579.   # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  580.   #----------------------------------------------------------------------
  581.   alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  582.   def update_phase3_basic_command
  583.     # C ボタンが押された場合
  584.     if Input.trigger?(Input::C)
  585.       # アクターコマンドウィンドウのカーソル位置で分岐
  586.       case @actor_command_window.index
  587.       when @cp_escape_actor_command_index # 逃げる
  588.         if $game_temp.battle_can_escape
  589.           # 決定 SE を演奏
  590.           $game_system.se_play($data_system.decision_se)
  591.           # アクションを設定
  592.           @active_battler.current_action.kind = 0
  593.           @active_battler.current_action.basic = 4
  594.           # 次のアクターのコマンド入力へ
  595.           phase3_next_actor
  596.         else
  597.           # ブザー SE を演奏
  598.           $game_system.se_play($data_system.buzzer_se)
  599.         end
  600.         return
  601.       end
  602.     end
  603.     xrxs_bsp1_update_phase3_basic_command
  604.   end
  605.   #----------------------------------------------------------------------
  606.   # ● メインフェーズ開始
  607.   #----------------------------------------------------------------------
  608.   alias xrxs_bp1_start_phase4 start_phase4
  609.   def start_phase4
  610.     # 呼び戻す
  611.     xrxs_bp1_start_phase4
  612.     # CPスレッドを一時停止する
  613.     unless @action_battlers.empty?
  614.       @cp_thread.stop = true
  615.     end
  616.   end
  617.   #----------------------------------------------------------------------
  618.   # ● 行動順序作成
  619.   #----------------------------------------------------------------------
  620.   alias xrxs_bp1_make_action_orders make_action_orders
  621.   def make_action_orders
  622.     xrxs_bp1_make_action_orders
  623.     # 全員のCPを確認
  624.     exclude_battler = []
  625.     for battler in @action_battlers
  626.       # CPが不足している場合は @action_battlers から除外する
  627.       if battler.cp < 65535
  628.         exclude_battler.push(battler)
  629.       end
  630.     end
  631.     @action_battlers -= exclude_battler
  632.   end
  633.   #----------------------------------------------------------------------
  634.   # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  635.   #----------------------------------------------------------------------
  636.   alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  637.   def update_phase4_step1
  638.     # 初期化
  639.     @phase4_act_continuation = 0
  640.     # 勝敗判定
  641.     if judge
  642.       @cp_thread.stop
  643.       # 勝利または敗北の場合 : メソッド終了
  644.       return
  645.     end
  646.     # 未行動バトラー配列の先頭から取得
  647.     @active_battler = @action_battlers[0]
  648.     # ステータス更新をCPだけに限定。
  649.     @status_window.update_cp_only = true
  650.     # ステート更新を禁止。
  651.     @active_battler.slip_state_update_ban = true if @active_battler != nil
  652.     # 戻す
  653.     xrxs_bp1_update_phase4_step1
  654.     # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  655.     if @phase4_step != 2
  656.       # リフレッシュ
  657.       @status_window.refresh
  658.       # 軽量化:たったコレだけΣ(?w?
  659.       Graphics.frame_reset
  660.     end
  661.     # 禁止を解除
  662.     @status_window.update_cp_only = false
  663.     @active_battler.slip_state_update_ban = false if @active_battler != nil
  664.   end
  665.   #----------------------------------------------------------------------
  666.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  667.   #----------------------------------------------------------------------
  668.   alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  669.   def update_phase4_step2
  670.     # 強制アクションでなければ
  671.     unless @active_battler.current_action.forcing
  672.       # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  673.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  674.         # アクションに攻撃を設定
  675.         @active_battler.current_action.kind = 0
  676.         @active_battler.current_action.basic = 0
  677.       end
  678.       # 制約が [行動できない] の場合
  679.       if @active_battler.restriction == 4
  680.         # アクション強制対象のバトラーをクリア
  681.         $game_temp.forcing_battler = nil
  682.         if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  683.           # ステート自然解除
  684.           @active_battler.remove_states_auto
  685.           # CP消費
  686.           @active_battler.cp -= 65535
  687.           # ステータスウィンドウをリフレッシュ
  688.           @status_window.refresh
  689.         end
  690.         # ステップ 1 に移行
  691.         @phase4_step = 1
  692.         return
  693.       end
  694.     end
  695.     # アクションの種別で分岐
  696.     case @active_battler.current_action.kind
  697.     when 0
  698.       # 攻撃?防御?逃げる?何もしない時の共通消費CP
  699.       @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  700.     when 1
  701.       # スキル使用時の消費CP
  702.       @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  703.     when 2
  704.       # アイテム使用時の消費CP
  705.       @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  706.     end
  707.     # ステート自然解除
  708.     @active_battler.remove_states_auto
  709.     # 呼び戻す
  710.     xrxs_bp1_update_phase4_step2
  711.   end
  712.   #----------------------------------------------------------------------
  713.   # ● 基本アクション 結果作成
  714.   #----------------------------------------------------------------------
  715.   alias xrxs_bp1_make_basic_action_result make_basic_action_result
  716.   def make_basic_action_result
  717.     # 攻撃の場合
  718.     if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  719.       @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  720.     end
  721.     # 防御の場合
  722.     if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  723.       @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  724.       # @active_battlerの防御をON
  725.       @active_battler.now_guarding = true
  726.     end
  727.     # 敵の逃げるの場合
  728.     if @active_battler.is_a?(Game_Enemy) and
  729.         @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  730.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  731.     end
  732.     # 何もしないの場合
  733.     if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  734.       @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  735.     end
  736.     # 逃げるの場合
  737.     if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  738.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  739.       # 逃走可能ではない場合
  740.       if $game_temp.battle_can_escape == false
  741.         # ブザー SE を演奏
  742.         $game_system.se_play($data_system.buzzer_se)
  743.         return
  744.       end
  745.       # 逃走処理
  746.       update_phase2_escape
  747.       return
  748.     end
  749.     # 呼び戻す
  750.     xrxs_bp1_make_basic_action_result
  751.   end
  752.   #----------------------------------------------------------------------
  753.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  754.   #----------------------------------------------------------------------
  755.   alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  756.   def update_phase4_step6
  757.     # スリップダメージ
  758.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  759.       @active_battler.slip_damage_effect
  760.       @active_battler.damage_pop = true
  761.       # ステータスウィンドウをリフレッシュ
  762.       @status_window.refresh
  763.     end
  764.     # 呼び戻す
  765.     xrxs_bp1_update_phase4_step6
  766.   end
  767. end
  768. #======================================================================
  769. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  770. #======================================================================
复制代码






Snipaste_2018-07-22_18-18-50.png (200.24 KB, 下载次数: 3)

这里的全部人对话后可以拉入队伍【全部人】

这里的全部人对话后可以拉入队伍【全部人】

Snipaste_2018-07-22_18-19-05.png (181.87 KB, 下载次数: 7)

全部人拉入队伍后去上面的传送门打怪

全部人拉入队伍后去上面的传送门打怪

Snipaste_2018-07-22_18-19-16.png (497.75 KB, 下载次数: 9)

打怪时,只后只要按到攻击或特技

打怪时,只后只要按到攻击或特技

Snipaste_2018-07-22_18-19-27.png (18.05 KB, 下载次数: 7)

就出现这个

就出现这个

Project2 (2).7z

402.47 KB, 下载次数: 45

这里是样本,如果能的话帮在下研究以下为什么会冲突。谢谢

梦想是谁创造的,梦想是自己创造的。站起来吧。
                      梦想由我们自己来创造。
  无论未来有多么困难,在下都会尽全力走下去。

Lv5.捕梦者

梦石
0
星屑
37789
在线时间
5399 小时
注册时间
2006-11-10
帖子
6546
2
发表于 2018-7-22 19:06:07 | 只看该作者
本帖最后由 灯笼菜刀王 于 2018-7-22 19:07 编辑

冲突的可能的地方, scene battle的 main 被重复覆盖. 导致了一个变量无赋值, 从错误上看, 应该是某个窗口或者图片(PS:这个分析只是针对你现在的问题,不排除还有其他的问题)

解决方法, 自己仔细的对比两个脚本这部分的差别, 把不同的地方合并到一起.

整合脚本是体力活, 枯燥又无趣(尤其不是自己写的脚本=.=), 自己的问题自己尝试解决吧, 记得备份. 以后碰到同样的问题就会处理了.

点评

上面不是说方法了,找到相同定义的方法,然后仔细的把它们之间不同的东西复制到同一个方法里面,删掉另一个方法就是整合。  发表于 2018-7-23 09:56
好的灯笼菜刀王前辈,但是,不知您能够给在下一个例子吗?比如怎么整合。  发表于 2018-7-22 22:27

评分

参与人数 1+1 收起 理由
黑白无双 + 1 精品文章

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
435
在线时间
150 小时
注册时间
2015-8-19
帖子
31
3
发表于 2018-7-22 21:00:58 | 只看该作者
怎么会以“在下”自称啊?中二病嘛?

评分

参与人数 1+1 收起 理由
黑白无双 + 1 每个人啊都有自己说话的方式,就打个比喻,.

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
504
在线时间
43 小时
注册时间
2018-2-19
帖子
66
4
 楼主| 发表于 2018-7-22 22:16:48 | 只看该作者
九尾的百合伞 发表于 2018-7-22 21:00
怎么会以“在下”自称啊?中二病嘛?

只是在下在以前玩游戏时用的说话方式而已,习惯了,改不了哦。至于什么是中二病呢?麻烦九尾的百合伞小姐来解释解释。本人并不知道这个词,还请您务必解释解释给我听
梦想是谁创造的,梦想是自己创造的。站起来吧。
                      梦想由我们自己来创造。
  无论未来有多么困难,在下都会尽全力走下去。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 18:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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