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

Project1

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

关于远小近大纵版战斗系统的问题(急需)

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2008-1-11
帖子
120
跳转到指定楼层
1
发表于 2008-1-12 00:36:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我看了下他的文件发现里面的动作都是分解的 但是有一个疑问,就是如果我想在加自己名字或加对手的名字 那么我应该怎么添加?
在代码中改?在哪改?怎么改?
--------------------------------------------------------------------------------我的意思也就是说如果我想给 怪物加动作和加人物
我应该改什么地方?  怎么个改法
急需(谢谢各位)
------------------------
远小近大纵版战斗系统
地址:http://rpg.blue/web/htm/news875.htm
版务信息:本贴由楼主自主结贴~
学习万千世界 搜索所有资料 只为一个承诺 啥时能做游戏

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2008-1-11
帖子
120
2
 楼主| 发表于 2008-1-12 00:36:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我看了下他的文件发现里面的动作都是分解的 但是有一个疑问,就是如果我想在加自己名字或加对手的名字 那么我应该怎么添加?
在代码中改?在哪改?怎么改?
--------------------------------------------------------------------------------我的意思也就是说如果我想给 怪物加动作和加人物
我应该改什么地方?  怎么个改法
急需(谢谢各位)
------------------------
远小近大纵版战斗系统
地址:http://rpg.blue/web/htm/news875.htm
版务信息:本贴由楼主自主结贴~
学习万千世界 搜索所有资料 只为一个承诺 啥时能做游戏

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2008-1-11
帖子
120
3
 楼主| 发表于 2008-1-12 02:20:46 | 只看该作者
还没有人 知道吗?
学习万千世界 搜索所有资料 只为一个承诺 啥时能做游戏
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2006-8-4
帖子
375
4
发表于 2008-1-12 02:22:54 | 只看该作者
Scene_BattleName
里面可以自定义

格式例:
  "角色名字" => {
  "角色动作1" => ["图片1的名字","图片2的名字"],
  "角色动作2" => ["图片1的名字","图片2的名字"],
  "角色动作3" => ["图片1的名字","图片2的名字"],
  },


角色名字要与数据库名字相同。
动作名字随便。动作数量不限
动作里面可以添加多个图片。添上相对应图片文件名字就好
名字都用 " " 引上。


设好后使用:

Scene_Battle 4

找到位置:  以下是例
  #--------------------------------------------------------------------------
  # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  #--------------------------------------------------------------------------
  def update_phase4_step3
    if @active_battler.current_action.basic == 0 and
      @active_battler.current_action.kind == 0
      @active_battler.startactive = "移动"
      @_move_duration = Move_Duration
      ox,oy,oz = @active_battler.screen_x,@active_battler.screen_y,@active_battler.screen_z
      @oldxyz = [@active_battler.screen_x,@active_battler.screen_y,@active_battler.screen_z]
      while @_move_duration > 0
        Graphics.update
        Input.update
        @spriteset.update
        tag = [@target_battlers[0].screen_x,@target_battlers[0].screen_y,@target_battlers[0].screen_z]
        move(@active_battler, tag, ox, oy, oz)
        @_move_duration -= 1
      end
      @active_battler.startactive = "待机"
    end

#这位置开始添加

    if @active_battler.current_action.basic == 0 and   #种类0,基本0。这是普通攻击  
      @active_battler.current_action.kind == 0
      @active_battler.startactive = "角色动作1"   #动作名要与Scene_BattleName里设好的相对应  ( Scene_BattleName 里边的动作名是什么 这里就填什么名字)
    end

    if @active_battler.current_action.kind == 1    #种类1 这是技能

     if @skill.id == 1                           #如果技能ID是1
      @active_battler.startactive = "角色动作2"   #动作名要与Scene_BattleName里设好的相对应( Scene_BattleName 里边的动作名是什么 这里就填什么名字)
     end
     if @skill.id == 2                           #如果技能ID是2
      @active_battler.startactive = "角色动作3"  #动作名要与Scene_BattleName里设好的相对应    ( Scene_BattleName 里边的动作名是什么 这里就填什么名字)
     end
    #等等技能可以往下继续设置
    end

#以上

    for target in @target_battlers
      target.animation_id = @animation2_id
      target.animation_hit = (target.damage != "Miss")
    end
    # 移至步骤 4
    @phase4_step = 4
  end

系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
哟~迷路了~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2008-1-11
帖子
120
5
 楼主| 发表于 2008-1-12 02:32:17 | 只看该作者
那如果是怪怎么加?
学习万千世界 搜索所有资料 只为一个承诺 啥时能做游戏
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2006-8-4
帖子
375
6
发表于 2008-1-12 02:52:04 | 只看该作者
一样啦。
"角色名字" => {     #---------->这个名字与数据库角色名字相同,以下动就属于该角色。同样。如果敌人的名字与这名字相同。那个敌人也用这套动作。

"角色动作1" => ["图片1的名字","图片2的名字"],
"角色动作2" => ["图片1的名字","图片2的名字"],
"角色动作3" => ["图片1的名字","图片2的名字"],
},
哟~迷路了~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2008-1-11
帖子
120
7
 楼主| 发表于 2008-1-12 03:03:01 | 只看该作者
"角色名字" => { 句话 提示错误
怎么办?  我写名字了
学习万千世界 搜索所有资料 只为一个承诺 啥时能做游戏
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2008-1-11
帖子
120
8
 楼主| 发表于 2008-1-12 03:06:27 | 只看该作者
Scene_BattleName
  1. #==============================================================================
  2. # ■ Scene_Name
  3. #------------------------------------------------------------------------------
  4. #  处理名称输入画面的类。
  5. #==============================================================================

  6. class Scene_Name
  7.   #--------------------------------------------------------------------------
  8.   # ● 主处理
  9.   #--------------------------------------------------------------------------
  10.   def main
  11.     # 获取角色
  12.     @actor = $game_actors[$game_temp.name_actor_id]
  13.     # 生成窗口
  14.     @edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)
  15.     @input_window = Window_NameInput.new
  16.     # 执行过渡
  17.     Graphics.transition
  18.     # 主循环
  19.     loop do
  20.       # 刷新游戏画面
  21.       Graphics.update
  22.       # 刷新输入信息
  23.       Input.update
  24.       # 刷新信息
  25.       update
  26.       # 如果画面切换就中断循环
  27.       if $scene != self
  28.         break
  29.       end
  30.     end
  31.     # 准备过渡
  32.     Graphics.freeze
  33.     # 释放窗口
  34.     @edit_window.dispose
  35.     @input_window.dispose
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ● 刷新画面
  39.   #--------------------------------------------------------------------------
  40.   def update
  41.     # 刷新窗口
  42.     @edit_window.update
  43.     @input_window.update
  44.     # 按下 B 键的情况下
  45.     if Input.repeat?(Input::B)
  46.       # 光标位置为 0 的情况下
  47.       if @edit_window.index == 0
  48.         return
  49.       end
  50.       # 演奏取消 SE
  51.       $game_system.se_play($data_system.cancel_se)
  52.       # 删除文字
  53.       @edit_window.back
  54.       return
  55.     end
  56.     # 按下 C 键的情况下
  57.     if Input.trigger?(Input::C)
  58.       # 光标位置为 [确定] 的情况下
  59.       if @input_window.character == nil
  60.         # 名称为空的情况下
  61.         if @edit_window.name == ""
  62.           # 还原为默认名称
  63.           @edit_window.restore_default
  64.           # 名称为空的情况下
  65.           if @edit_window.name == ""
  66.             # 演奏冻结 SE
  67.             $game_system.se_play($data_system.buzzer_se)
  68.             return
  69.           end
  70.           # 演奏确定 SE
  71.           $game_system.se_play($data_system.decision_se)
  72.           return
  73.         end
  74.         # 更改角色名称
  75.         @actor.name = @edit_window.name
  76.         # 演奏确定 SE
  77.         $game_system.se_play($data_system.decision_se)
  78.         # 切换到地图画面
  79.         $scene = Scene_Map.new
  80.         return
  81.       end
  82.       # 光标位置为最大的情况下
  83.       if @edit_window.index == $game_temp.name_max_char
  84.         # 演奏冻结 SE
  85.         $game_system.se_play($data_system.buzzer_se)
  86.         return
  87.       end
  88.       # 文字为空的情况下
  89.       if @input_window.character == ""
  90.         # 演奏冻结 SE
  91.         $game_system.se_play($data_system.buzzer_se)
  92.         return
  93.       end
  94.       # 演奏确定 SE
  95.       $game_system.se_play($data_system.decision_se)
  96.       # 添加文字
  97.       @edit_window.add(@input_window.character)
  98.       return
  99.     end
  100.   end
  101. end
复制代码

Scene_Battle 4
  1. #==============================================================================
  2. # ■ Scene_Battle (分割定义 4)
  3. #------------------------------------------------------------------------------
  4. #  处理战斗画面的类。
  5. #==============================================================================

  6. class Scene_Battle
  7.   #--------------------------------------------------------------------------
  8.   # ● 开始主回合
  9.   #--------------------------------------------------------------------------
  10.   def start_phase4
  11.     # 转移到回合 4
  12.     @phase = 4
  13.     # 回合数计数
  14.     $game_temp.battle_turn += 1
  15.     # 搜索全页的战斗事件
  16.     for index in 0...$data_troops[@troop_id].pages.size
  17.       # 获取事件页
  18.       page = $data_troops[@troop_id].pages[index]
  19.       # 本页的范围是 [回合] 的情况下
  20.       if page.span == 1
  21.         # 设置已经执行标志
  22.         $game_temp.battle_event_flags[index] = false
  23.       end
  24.     end
  25.     # 设置角色为非选择状态
  26.     @actor_index = -1
  27.     @active_battler = nil
  28.     # 有效化同伴指令窗口
  29.     @party_command_window.active = false
  30.     @party_command_window.visible = false
  31.     # 无效化角色指令窗口
  32.     @actor_command_window.active = false
  33.     @actor_command_window.visible = false
  34.     # 设置主回合标志
  35.     $game_temp.battle_main_phase = true
  36.     # 生成敌人行动
  37.     for enemy in $game_troop.enemies
  38.       enemy.make_action
  39.     end
  40.     # 生成行动顺序
  41.     make_action_orders
  42.     # 移动到步骤 1
  43.     @phase4_step = 1
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 生成行动循序
  47.   #--------------------------------------------------------------------------
  48.   def make_action_orders
  49.     # 初始化序列 @action_battlers
  50.     @action_battlers = []
  51.     # 添加敌人到 @action_battlers 序列
  52.     for enemy in $game_troop.enemies
  53.       @action_battlers.push(enemy)
  54.     end
  55.     # 添加角色到 @action_battlers 序列
  56.     for actor in $game_party.actors
  57.       @action_battlers.push(actor)
  58.     end
  59.     # 确定全体的行动速度
  60.     for battler in @action_battlers
  61.       battler.make_action_speed
  62.     end
  63.     # 按照行动速度从大到小排列
  64.     @action_battlers.sort! {|a,b|
  65.       b.current_action.speed - a.current_action.speed }
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 刷新画面 (主回合)
  69.   #--------------------------------------------------------------------------
  70.   def update_phase4
  71.     case @phase4_step
  72.     when 1
  73.       update_phase4_step1
  74.     when 2
  75.       update_phase4_step2
  76.     when 3
  77.       update_phase4_step3
  78.     when 4
  79.       update_phase4_step4
  80.     when 5
  81.       update_phase4_step5
  82.     when 6
  83.       update_phase4_step6
  84.     end
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 刷新画面 (主回合步骤 1 : 准备行动)
  88.   #--------------------------------------------------------------------------
  89.   def update_phase4_step1
  90.     # 隐藏帮助窗口
  91.     @help_window.visible = false
  92.     # 判定胜败
  93.     if judge
  94.       # 胜利或者失败的情况下 : 过程结束
  95.       return
  96.     end
  97.     # 强制行动的战斗者不存在的情况下
  98.     if $game_temp.forcing_battler == nil
  99.       # 设置战斗事件
  100.       setup_battle_event
  101.       # 执行战斗事件中的情况下
  102.       if $game_system.battle_interpreter.running?
  103.         return
  104.       end
  105.     end
  106.     # 强制行动的战斗者存在的情况下
  107.     if $game_temp.forcing_battler != nil
  108.       # 在头部添加后移动
  109.       @action_battlers.delete($game_temp.forcing_battler)
  110.       @action_battlers.unshift($game_temp.forcing_battler)
  111.     end
  112.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  113.     if @action_battlers.size == 0
  114.       # 开始同伴命令回合
  115.       start_phase2
  116.       return
  117.     end
  118.     # 初始化动画 ID 和公共事件 ID
  119.     @animation1_id = 0
  120.     @animation2_id = 0
  121.     @common_event_id = 0
  122.     # 未行动的战斗者移动到序列的头部
  123.     @active_battler = @action_battlers.shift
  124.     # 如果已经在战斗之外的情况下
  125.     if @active_battler.index == nil
  126.       return
  127.     end
  128.     # 连续伤害
  129.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  130.       @active_battler.slip_damage_effect
  131.       @active_battler.damage_pop = true
  132.     end
  133.     # 自然解除状态
  134.     @active_battler.remove_states_auto
  135.     # 刷新状态窗口
  136.     @status_window.refresh
  137.     # 移至步骤 2
  138.     @phase4_step = 2
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● 刷新画面 (主回合步骤 2 : 开始行动)
  142.   #--------------------------------------------------------------------------
  143.   def update_phase4_step2
  144.     # 如果不是强制行动
  145.     unless @active_battler.current_action.forcing
  146.       # 限制为 [敌人为普通攻击] 或 [我方为普通攻击] 的情况下
  147.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  148.         # 设置行动为攻击
  149.         @active_battler.current_action.kind = 0
  150.         @active_battler.current_action.basic = 0
  151.       end
  152.       # 限制为 [不能行动] 的情况下
  153.       if @active_battler.restriction == 4
  154.         # 清除行动强制对像的战斗者
  155.         $game_temp.forcing_battler = nil
  156.         # 移至步骤 1
  157.         @phase4_step = 1
  158.         return
  159.       end
  160.     end
  161.     # 清除对像战斗者
  162.     @target_battlers = []
  163.     # 行动种类分支
  164.     case @active_battler.current_action.kind
  165.     when 0  # 基本
  166.       make_basic_action_result
  167.     when 1  # 特技
  168.       make_skill_action_result
  169.     when 2  # 物品
  170.       make_item_action_result
  171.     end
  172.     # 移至步骤 3
  173.     if @phase4_step == 2
  174.       @phase4_step = 3
  175.     end
  176.   end
  177.   #--------------------------------------------------------------------------
  178. # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  179. #--------------------------------------------------------------------------
  180. def update_phase4_step3
  181.    if @active_battler.current_action.basic == 0 and
  182.      @active_battler.current_action.kind == 0
  183.      @active_battler.startactive = "移动"
  184.      @_move_duration = Move_Duration
  185.      ox,oy,oz = @active_battler.screen_x,@active_battler.screen_y,@active_battler.screen_z
  186.      @oldxyz = [@active_battler.screen_x,@active_battler.screen_y,@active_battler.screen_z]
  187.      while @_move_duration > 0
  188.        Graphics.update
  189.        Input.update
  190.        @spriteset.update
  191.        tag = [@target_battlers[0].screen_x,@target_battlers[0].screen_y,@target_battlers[0].screen_z]
  192.        move(@active_battler, tag, ox, oy, oz)
  193.        @_move_duration -= 1
  194.      end
  195.      @active_battler.startactive = "待机"
  196.    end

  197. #这位置开始添加

  198.    if @active_battler.current_action.basic == 0 and   #种类0,基本0。这是普通攻击  
  199.      @active_battler.current_action.kind == 0
  200.      @active_battler.startactive = "角色动作1"   #动作名要与Scene_BattleName里设好的相对应  ( Scene_BattleName 里边的动作名是什么 这里就填什么名字)
  201.    end

  202.    if @active_battler.current_action.kind == 1    #种类1 这是技能

  203.     if @skill.id == 1                           #如果技能ID是1
  204.      @active_battler.startactive = "角色动作2"   #动作名要与Scene_BattleName里设好的相对应( Scene_BattleName 里边的动作名是什么 这里就填什么名字)
  205.     end
  206.     if @skill.id == 2                           #如果技能ID是2
  207.      @active_battler.startactive = "角色动作3"  #动作名要与Scene_BattleName里设好的相对应    ( Scene_BattleName 里边的动作名是什么 这里就填什么名字)
  208.     end
  209.    #等等技能可以往下继续设置
  210.    end

  211. #以上

  212.    for target in @target_battlers
  213.      target.animation_id = @animation2_id
  214.      target.animation_hit = (target.damage != "Miss")
  215.    end
  216.    # 移至步骤 4
  217.    @phase4_step = 4
  218. end
  219.   #--------------------------------------------------------------------------
  220.   # ● 生成基本行动结果
  221.   #--------------------------------------------------------------------------
  222.   def make_basic_action_result
  223.     # 攻击的情况下
  224.     if @active_battler.current_action.basic == 0
  225.       # 设置攻击 ID
  226.       @animation1_id = @active_battler.animation1_id
  227.       @animation2_id = @active_battler.animation2_id
  228.       # 行动方的战斗者是敌人的情况下
  229.       if @active_battler.is_a?(Game_Enemy)
  230.         if @active_battler.restriction == 3
  231.           target = $game_troop.random_target_enemy
  232.         elsif @active_battler.restriction == 2
  233.           target = $game_party.random_target_actor
  234.         else
  235.           index = @active_battler.current_action.target_index
  236.           target = $game_party.smooth_target_actor(index)
  237.         end
  238.       end
  239.       # 行动方的战斗者是角色的情况下
  240.       if @active_battler.is_a?(Game_Actor)
  241.         if @active_battler.restriction == 3
  242.           target = $game_party.random_target_actor
  243.         elsif @active_battler.restriction == 2
  244.           target = $game_troop.random_target_enemy
  245.         else
  246.           index = @active_battler.current_action.target_index
  247.           target = $game_troop.smooth_target_enemy(index)
  248.         end
  249.       end
  250.       # 设置对像方的战斗者序列
  251.       @target_battlers = [target]
  252.       # 应用通常攻击效果
  253.       for target in @target_battlers
  254.         target.attack_effect(@active_battler)
  255.       end
  256.       return
  257.     end
  258.     # 防御的情况下
  259.     if @active_battler.current_action.basic == 1
  260.       # 帮助窗口显示"防御"
  261.       @help_window.set_text($data_system.words.guard, 1)
  262.       return
  263.     end
  264.     # 逃跑的情况下
  265.     if @active_battler.is_a?(Game_Enemy) and
  266.        @active_battler.current_action.basic == 2
  267.       #  帮助窗口显示"逃跑"
  268.       @help_window.set_text("逃跑", 1)
  269.       # 逃跑
  270.       @active_battler.escape
  271.       return
  272.     end
  273.     # 什么也不做的情况下
  274.     if @active_battler.current_action.basic == 3
  275.       # 清除强制行动对像的战斗者
  276.       $game_temp.forcing_battler = nil
  277.       # 移至步骤 1
  278.       @phase4_step = 1
  279.       return
  280.     end
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 设置物品或特技对像方的战斗者
  284.   #     scope : 特技或者是物品的范围
  285.   #--------------------------------------------------------------------------
  286.   def set_target_battlers(scope)
  287.     # 行动方的战斗者是敌人的情况下
  288.     if @active_battler.is_a?(Game_Enemy)
  289.       # 效果范围分支
  290.       case scope
  291.       when 1  # 敌单体
  292.         index = @active_battler.current_action.target_index
  293.         @target_battlers.push($game_party.smooth_target_actor(index))
  294.       when 2  # 敌全体
  295.         for actor in $game_party.actors
  296.           if actor.exist?
  297.             @target_battlers.push(actor)
  298.           end
  299.         end
  300.       when 3  # 我方单体
  301.         index = @active_battler.current_action.target_index
  302.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  303.       when 4  # 我方全体
  304.         for enemy in $game_troop.enemies
  305.           if enemy.exist?
  306.             @target_battlers.push(enemy)
  307.           end
  308.         end
  309.       when 5  # 我方单体 (HP 0)
  310.         index = @active_battler.current_action.target_index
  311.         enemy = $game_troop.enemies[index]
  312.         if enemy != nil and enemy.hp0?
  313.           @target_battlers.push(enemy)
  314.         end
  315.       when 6  # 我方全体 (HP 0)
  316.         for enemy in $game_troop.enemies
  317.           if enemy != nil and enemy.hp0?
  318.             @target_battlers.push(enemy)
  319.           end
  320.         end
  321.       when 7  # 使用者
  322.         @target_battlers.push(@active_battler)
  323.       end
  324.     end
  325.     # 行动方的战斗者是角色的情况下
  326.     if @active_battler.is_a?(Game_Actor)
  327.       # 效果范围分支
  328.       case scope
  329.       when 1  # 敌单体
  330.         index = @active_battler.current_action.target_index
  331.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  332.       when 2  # 敌全体
  333.         for enemy in $game_troop.enemies
  334.           if enemy.exist?
  335.             @target_battlers.push(enemy)
  336.           end
  337.         end
  338.       when 3  # 我方单体
  339.         index = @active_battler.current_action.target_index
  340.         @target_battlers.push($game_party.smooth_target_actor(index))
  341.       when 4  # 我方全体
  342.         for actor in $game_party.actors
  343.           if actor.exist?
  344.             @target_battlers.push(actor)
  345.           end
  346.         end
  347.       when 5  # 我方单体 (HP 0)
  348.         index = @active_battler.current_action.target_index
  349.         actor = $game_party.actors[index]
  350.         if actor != nil and actor.hp0?
  351.           @target_battlers.push(actor)
  352.         end
  353.       when 6  # 我方全体 (HP 0)
  354.         for actor in $game_party.actors
  355.           if actor != nil and actor.hp0?
  356.             @target_battlers.push(actor)
  357.           end
  358.         end
  359.       when 7  # 使用者
  360.         @target_battlers.push(@active_battler)
  361.       end
  362.     end
  363.   end
  364.   #--------------------------------------------------------------------------
  365.   # ● 生成特技行动结果
  366.   #--------------------------------------------------------------------------
  367.   def make_skill_action_result
  368.     # 获取特技
  369.     @skill = $data_skills[@active_battler.current_action.skill_id]
  370.     # 如果不是强制行动
  371.     unless @active_battler.current_action.forcing
  372.       # 因为 SP 耗尽而无法使用的情况下
  373.       unless @active_battler.skill_can_use?(@skill.id)
  374.         # 清除强制行动对像的战斗者
  375.         $game_temp.forcing_battler = nil
  376.         # 移至步骤 1
  377.         @phase4_step = 1
  378.         return
  379.       end
  380.     end
  381.     # 消耗 SP
  382.     @active_battler.sp -= @skill.sp_cost
  383.     # 刷新状态窗口
  384.     @status_window.refresh
  385.     # 在帮助窗口显示特技名
  386.     @help_window.set_text(@skill.name, 1)
  387.     # 设置动画 ID
  388.     @animation1_id = @skill.animation1_id
  389.     @animation2_id = @skill.animation2_id
  390.     # 设置公共事件 ID
  391.     @common_event_id = @skill.common_event_id
  392.     # 设置对像侧战斗者
  393.     set_target_battlers(@skill.scope)
  394.     # 应用特技效果
  395.     for target in @target_battlers
  396.       target.skill_effect(@active_battler, @skill)
  397.     end
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● 生成物品行动结果
  401.   #--------------------------------------------------------------------------
  402.   def make_item_action_result
  403.     # 获取物品
  404.     @item = $data_items[@active_battler.current_action.item_id]
  405.     # 因为物品耗尽而无法使用的情况下
  406.     unless $game_party.item_can_use?(@item.id)
  407.       # 移至步骤 1
  408.       @phase4_step = 1
  409.       return
  410.     end
  411.     # 消耗品的情况下
  412.     if @item.consumable
  413.       # 使用的物品减 1
  414.       $game_party.lose_item(@item.id, 1)
  415.     end
  416.     # 在帮助窗口显示物品名
  417.     @help_window.set_text(@item.name, 1)
  418.     # 设置动画 ID
  419.     @animation1_id = @item.animation1_id
  420.     @animation2_id = @item.animation2_id
  421.     # 设置公共事件 ID
  422.     @common_event_id = @item.common_event_id
  423.     # 确定对像
  424.     index = @active_battler.current_action.target_index
  425.     target = $game_party.smooth_target_actor(index)
  426.     # 设置对像侧战斗者
  427.     set_target_battlers(@item.scope)
  428.     # 应用物品效果
  429.     for target in @target_battlers
  430.       target.item_effect(@item)
  431.     end
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  435.   #--------------------------------------------------------------------------
  436.   def update_phase4_step3
  437.     if @active_battler.current_action.basic == 0 and
  438.       @active_battler.current_action.kind == 0
  439.       @active_battler.startactive = "移动"
  440.       @_move_duration = Move_Duration
  441.       ox,oy,oz = @active_battler.screen_x,@active_battler.screen_y,@active_battler.screen_z
  442.       @oldxyz = [@active_battler.screen_x,@active_battler.screen_y,@active_battler.screen_z]
  443.       while @_move_duration > 0
  444.         Graphics.update
  445.         Input.update
  446.         @spriteset.update
  447.         tag = [@target_battlers[0].screen_x,@target_battlers[0].screen_y,@target_battlers[0].screen_z]
  448.         move(@active_battler, tag, ox, oy, oz)
  449.         @_move_duration -= 1
  450.       end
  451.       @active_battler.startactive = "待机"
  452.     end
  453.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  454.     if @animation1_id == 0
  455.       @active_battler.white_flash = true
  456.     else
  457.       @active_battler.animation_id = @animation1_id
  458. #      @active_battler.startactive = "攻击"
  459.       @active_battler.animation_hit = true
  460.     end
  461.     for target in @target_battlers
  462.       target.animation_id = @animation2_id
  463.       target.animation_hit = (target.damage != "Miss")
  464.     end
  465.     # 移至步骤 4
  466.     @phase4_step = 4
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  470.   #--------------------------------------------------------------------------
  471.   def update_phase4_step4
  472.     # 刷新状态窗口
  473.     @status_window.refresh
  474.     # 对像方动画
  475.     for target in @target_battlers
  476.       #target.animation_id = @animation2_id
  477.       #target.animation_hit = (target.damage != "Miss")
  478.       if target.damage != nil
  479.         target.damage_pop = true
  480.       end
  481.     end
  482.     # 限制动画长度、最低 8 帧
  483.     #@wait_count = 4
  484.     # 移至步骤 5
  485.     @phase4_step = 5
  486.   end
  487.   #--------------------------------------------------------------------------
  488.   # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  489.   #--------------------------------------------------------------------------
  490.   def update_phase4_step5
  491.     # 隐藏帮助窗口
  492.     @help_window.visible = false
  493.    
  494.     if @active_battler.current_action.basic == 0 and
  495.       @active_battler.current_action.kind == 0
  496.       @active_battler.startactive = "返回"
  497.       @_move_duration = Move_Duration
  498.       ox,oy,oz = @active_battler.screen_x - @active_battler.movex,
  499.       @active_battler.screen_y - @active_battler.movey,
  500.       @active_battler.screen_z - @active_battler.movez
  501.       while @_move_duration > 0
  502.         Graphics.update
  503.         Input.update
  504.         @spriteset.update
  505.         move(@active_battler, @oldxyz, ox, oy, oz, true)
  506.         @_move_duration -= 1
  507.       end
  508.       @active_battler.startactive = "待机"
  509.     end
  510.    
  511.     @phase4_step = 6
  512.     return
  513.     # 显示伤害
  514.     for target in @target_battlers
  515.       if target.damage != nil
  516.         target.damage_pop = true
  517.       end
  518.     end
  519.     # 移至步骤 6
  520.     @phase4_step = 6
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # ● 刷新画面 (主回合步骤 6 : 刷新)
  524.   #--------------------------------------------------------------------------
  525.   def update_phase4_step6
  526.     # 清除强制行动对像的战斗者
  527.     $game_temp.forcing_battler = nil
  528.     @active_battler.movex = 0
  529.     @active_battler.movey = 0
  530.     @active_battler.movez = 0
  531.     # 公共事件 ID 有效的情况下
  532.     if @common_event_id > 0
  533.       # 设置事件
  534.       common_event = $data_common_events[@common_event_id]
  535.       $game_system.battle_interpreter.setup(common_event.list, 0)
  536.     end
  537.     # 移至步骤 1
  538.     @phase4_step = 1
  539.   end
  540.   #--------------------------------------------------------------------------
  541.   # ● 移动 (攻击者) (被攻击者)#(active_battler.width / 2)
  542.   #--------------------------------------------------------------------------
  543.   def move(active_battler, target, ox, oy, oz, 返回标记 = false)
  544.     ta_x = target[0]
  545.     ta_y = target[1]
  546.     ta_z = target[2]
  547.     if 返回标记
  548.       active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox) / @_move_duration
  549.       active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy) / @_move_duration
  550.       active_battler.movez = (active_battler.movez * (@_move_duration - 1) + ta_z.to_f - oz) / @_move_duration
  551.     else
  552.     if @active_battler.is_a?(Game_Enemy)
  553.       active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox) / @_move_duration
  554.       active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy - 32) / @_move_duration
  555.       active_battler.movez = (active_battler.movez * (@_move_duration - 1) + ta_z.to_f - oz - 64) / @_move_duration
  556.     else
  557.       active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox) / @_move_duration
  558.       active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy + 10) / @_move_duration
  559.       active_battler.movez = (active_battler.movez * (@_move_duration - 1) + ta_z.to_f - oz + 20) / @_move_duration   
  560.       end
  561.     end
  562.   end
  563. end
复制代码
学习万千世界 搜索所有资料 只为一个承诺 啥时能做游戏
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
1 小时
注册时间
2008-1-11
帖子
120
9
 楼主| 发表于 2008-1-12 03:07:47 | 只看该作者
麻烦看下对不?
第1个没添
添在什么地方?
第2个添的地方对吧?
学习万千世界 搜索所有资料 只为一个承诺 啥时能做游戏
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2006-8-4
帖子
375
10
发表于 2008-1-12 03:10:15 | 只看该作者
是 Scene_BattleName  

no Scene_Name
哟~迷路了~
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-27 22:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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