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

Project1

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

[已经解决] 一个传递伤害的状态

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
43 小时
注册时间
2012-9-8
帖子
38
跳转到指定楼层
1
发表于 2012-9-21 19:23:44 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
不要骂我没有搜索!我找了1周木有找到!
一个传递伤害的状态要怎么做呢?
我想做一个状态,凡是有这个状态的角色受到炎属性或者雷属性的伤害时会把伤害传递给拥有这个状态的所有角色,然后这个状态消失!
麻烦了!{:2_270:}

Lv3.寻梦者

梦石
0
星屑
1058
在线时间
878 小时
注册时间
2012-6-28
帖子
1079
2
发表于 2012-9-22 00:14:55 | 只看该作者
我大概知道你想复刻三国杀rmxp版是吧
我提醒你这是个艰巨的任务,但也鼓励你坚持自己的梦想
我的回答只解决你问的问题,帮你找个思路
至于其他的问题,比如遇到藤甲怎么办?火焰扇子打出的普通杀怎么让它有属性我就不一一作答了










整个三国杀系统如果用rm的事件来编写将变得庞大而复杂,所以我的建议还是你去学脚本,再复刻三国杀
加油,坚持自己的梦

点评

强大。。。。。。。。。。  发表于 2012-9-22 18:59

评分

参与人数 3星屑 +260 收起 理由
hys111111 + 200 (元素天使:70)
Password + 44 很好很强大……
小商贩 + 16 竟然用事件做出这么复杂的东西,佩服.

查看全部评分

不追求华丽的商业素材;不依赖与自己运用能力不符的外挂脚本;不搞华而不实的无用噱头。
                    修改,使用最朴实的素材,融入自己的智慧做最好的游戏!
                                    点这里!暂不设加入门槛
         
                               我觉得我的优点是,会认真的画每一张地图。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
43 小时
注册时间
2012-9-8
帖子
38
3
 楼主| 发表于 2012-9-27 14:45:04 | 只看该作者
没是的人 发表于 2012-9-22 00:14
我大概知道你想复刻三国杀rmxp版是吧
我提醒你这是个艰巨的任务,但也鼓励你坚持自己的梦想
我的回答只解决 ...

很好很强大你竟然猜出我在做什么了,我的确是想复刻三国杀,但是用事件去制作铁索的状态恐怕我的角色和敌人的数目会让电脑吃不消……
我会尽快学会脚本的,
但是在这之前我想有人帮我完成这个脚本……
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3444
在线时间
3054 小时
注册时间
2011-11-17
帖子
980
4
发表于 2012-9-27 18:55:35 | 只看该作者
  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.   # ● 生成基本行动结果
  179.   #--------------------------------------------------------------------------
  180.   def make_basic_action_result
  181.     # 攻击的情况下
  182.     if @active_battler.current_action.basic == 0
  183.       # 设置攻击 ID
  184.       @animation1_id = @active_battler.animation1_id
  185.       @animation2_id = @active_battler.animation2_id
  186.       # 行动方的战斗者是敌人的情况下
  187.       if @active_battler.is_a?(Game_Enemy)
  188.         if @active_battler.restriction == 3
  189.           target = $game_troop.random_target_enemy
  190.         elsif @active_battler.restriction == 2
  191.           target = $game_party.random_target_actor
  192.         else
  193.           index = @active_battler.current_action.target_index
  194.           target = $game_party.smooth_target_actor(index)
  195.         end
  196.       end
  197.       # 行动方的战斗者是角色的情况下
  198.       if @active_battler.is_a?(Game_Actor)
  199.         if @active_battler.restriction == 3
  200.           target = $game_party.random_target_actor
  201.         elsif @active_battler.restriction == 2
  202.           target = $game_troop.random_target_enemy
  203.         else
  204.           index = @active_battler.current_action.target_index
  205.           target = $game_troop.smooth_target_enemy(index)
  206.         end
  207.       end
  208.       # 设置对像方的战斗者序列
  209.       @target_battlers = [target]
  210.       # 应用通常攻击效果
  211.       for target in @target_battlers
  212.         target.attack_effect(@active_battler)
  213.       end
  214.       return
  215.     end
  216.     # 防御的情况下
  217.     if @active_battler.current_action.basic == 1
  218.       # 帮助窗口显示"防御"
  219.       @help_window.set_text($data_system.words.guard, 1)
  220.       return
  221.     end
  222.     # 逃跑的情况下
  223.     if @active_battler.is_a?(Game_Enemy) and
  224.        @active_battler.current_action.basic == 2
  225.       #  帮助窗口显示"逃跑"
  226.       @help_window.set_text("逃跑", 1)
  227.       # 逃跑
  228.       @active_battler.escape
  229.       return
  230.     end
  231.     # 什么也不做的情况下
  232.     if @active_battler.current_action.basic == 3
  233.       # 清除强制行动对像的战斗者
  234.       $game_temp.forcing_battler = nil
  235.       # 移至步骤 1
  236.       @phase4_step = 1
  237.       return
  238.     end
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● 设置物品或特技对像方的战斗者
  242.   #     scope : 特技或者是物品的范围
  243.   #--------------------------------------------------------------------------
  244.   def set_target_battlers(scope)
  245.     # 行动方的战斗者是敌人的情况下
  246.     if @active_battler.is_a?(Game_Enemy)
  247.       # 效果范围分支
  248.       case scope
  249.       when 1  # 敌单体
  250.         index = @active_battler.current_action.target_index
  251.         if $game_party.smooth_target_actor(index).states.include?(21) and @skill.id == 57
  252.           for actor in $game_party.actors
  253.            @target_battlers.push(actor) if actor.exist? and actor.states.include?(21)
  254.           end
  255.          for enemy in $game_troop.enemies
  256.             @target_battlers.push(enemy) if enemy.exist? and enemy.states.include?(21)
  257.         end
  258.           else
  259.         @target_battlers.push($game_party.smooth_target_actor(index))
  260.         end
  261.         
  262.         
  263.       when 2  # 敌全体
  264.         for actor in $game_party.actors
  265.           if actor.exist?
  266.             @target_battlers.push(actor)
  267.           end
  268.         end
  269.       when 3  # 我方单体
  270.         index = @active_battler.current_action.target_index
  271.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  272.       when 4  # 我方全体
  273.         for enemy in $game_troop.enemies
  274.           if enemy.exist?
  275.             @target_battlers.push(enemy)
  276.           end
  277.         end
  278.       when 5  # 我方单体 (HP 0)
  279.         index = @active_battler.current_action.target_index
  280.         enemy = $game_troop.enemies[index]
  281.         if enemy != nil and enemy.hp0?
  282.           @target_battlers.push(enemy)
  283.         end
  284.       when 6  # 我方全体 (HP 0)
  285.         for enemy in $game_troop.enemies
  286.           if enemy != nil and enemy.hp0?
  287.             @target_battlers.push(enemy)
  288.           end
  289.         end
  290.       when 7  # 使用者
  291.         @target_battlers.push(@active_battler)
  292.       end
  293.     end
  294.     # 行动方的战斗者是角色的情况下
  295.     if @active_battler.is_a?(Game_Actor)
  296.       # 效果范围分支
  297.       case scope
  298.       when 1  # 敌单体
  299.         index = @active_battler.current_action.target_index
  300.            if $game_troop.smooth_target_enemy(index).states.include?(21) and @skill.id == 57
  301.           for actor in $game_party.actors
  302.            @target_battlers.push(actor) if actor.exist? and actor.states.include?(21)
  303.           end
  304.          for enemy in $game_troop.enemies
  305.             @target_battlers.push(enemy) if enemy.exist? and enemy.states.include?(21)
  306.         end
  307.         else
  308.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  309.         end
  310.       when 2  # 敌全体
  311.         for enemy in $game_troop.enemies
  312.           if enemy.exist?
  313.             @target_battlers.push(enemy)
  314.           end
  315.         end
  316.       when 3  # 我方单体
  317.         index = @active_battler.current_action.target_index
  318.         @target_battlers.push($game_party.smooth_target_actor(index))
  319.       when 4  # 我方全体
  320.         for actor in $game_party.actors
  321.           if actor.exist?
  322.             @target_battlers.push(actor)
  323.           end
  324.         end
  325.       when 5  # 我方单体 (HP 0)
  326.         index = @active_battler.current_action.target_index
  327.         actor = $game_party.actors[index]
  328.         if actor != nil and actor.hp0?
  329.           @target_battlers.push(actor)
  330.         end
  331.       when 6  # 我方全体 (HP 0)
  332.         for actor in $game_party.actors
  333.           if actor != nil and actor.hp0?
  334.             @target_battlers.push(actor)
  335.           end
  336.         end
  337.       when 7  # 使用者
  338.         @target_battlers.push(@active_battler)
  339.       end
  340.     end
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ● 生成特技行动结果
  344.   #--------------------------------------------------------------------------
  345.   def make_skill_action_result
  346.     # 获取特技
  347.     @skill = $data_skills[@active_battler.current_action.skill_id]
  348.     # 如果不是强制行动
  349.     unless @active_battler.current_action.forcing
  350.       # 因为 SP 耗尽而无法使用的情况下
  351.       unless @active_battler.skill_can_use?(@skill.id)
  352.         # 清除强制行动对像的战斗者
  353.         $game_temp.forcing_battler = nil
  354.         # 移至步骤 1
  355.         @phase4_step = 1
  356.         return
  357.       end
  358.     end
  359.     # 消耗 SP
  360.     @active_battler.sp -= @skill.sp_cost
  361.     # 刷新状态窗口
  362.     @status_window.refresh
  363.     # 在帮助窗口显示特技名
  364.     @help_window.set_text(@skill.name, 1)
  365.     # 设置动画 ID
  366.     @animation1_id = @skill.animation1_id
  367.     @animation2_id = @skill.animation2_id
  368.     # 设置公共事件 ID
  369.     @common_event_id = @skill.common_event_id
  370.     # 设置对像侧战斗者
  371.     set_target_battlers(@skill.scope)
  372.     # 应用特技效果
  373.     for target in @target_battlers
  374.       target.skill_effect(@active_battler, @skill)
  375.     end
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● 生成物品行动结果
  379.   #--------------------------------------------------------------------------
  380.   def make_item_action_result
  381.     # 获取物品
  382.     @item = $data_items[@active_battler.current_action.item_id]
  383.     # 因为物品耗尽而无法使用的情况下
  384.     unless $game_party.item_can_use?(@item.id)
  385.       # 移至步骤 1
  386.       @phase4_step = 1
  387.       return
  388.     end
  389.     # 消耗品的情况下
  390.     if @item.consumable
  391.       # 使用的物品减 1
  392.       $game_party.lose_item(@item.id, 1)
  393.     end
  394.     # 在帮助窗口显示物品名
  395.     @help_window.set_text(@item.name, 1)
  396.     # 设置动画 ID
  397.     @animation1_id = @item.animation1_id
  398.     @animation2_id = @item.animation2_id
  399.     # 设置公共事件 ID
  400.     @common_event_id = @item.common_event_id
  401.     # 确定对像
  402.     index = @active_battler.current_action.target_index
  403.     target = $game_party.smooth_target_actor(index)
  404.     # 设置对像侧战斗者
  405.     set_target_battlers(@item.scope)
  406.     # 应用物品效果
  407.     for target in @target_battlers
  408.       target.item_effect(@item)
  409.     end
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  413.   #--------------------------------------------------------------------------
  414.   def update_phase4_step3
  415.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  416.     if @animation1_id == 0
  417.       @active_battler.white_flash = true
  418.     else
  419.       @active_battler.animation_id = @animation1_id
  420.       @active_battler.animation_hit = true
  421.     end
  422.     # 移至步骤 4
  423.     @phase4_step = 4
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  427.   #--------------------------------------------------------------------------
  428.   def update_phase4_step4
  429.     # 对像方动画
  430.     for target in @target_battlers
  431.       target.animation_id = @animation2_id
  432.       target.animation_hit = (target.damage != "Miss")
  433.     end
  434.     # 限制动画长度、最低 8 帧
  435.     @wait_count = 8
  436.     # 移至步骤 5
  437.     @phase4_step = 5
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  441.   #--------------------------------------------------------------------------
  442.   def update_phase4_step5
  443.     # 隐藏帮助窗口
  444.     @help_window.visible = false
  445.     # 刷新状态窗口
  446.     @status_window.refresh
  447.     # 显示伤害
  448.     for target in @target_battlers
  449.       if target.damage != nil
  450.         target.damage_pop = true
  451.       end
  452.     end
  453.     # 移至步骤 6
  454.     @phase4_step = 6
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● 刷新画面 (主回合步骤 6 : 刷新)
  458.   #--------------------------------------------------------------------------
  459.   def update_phase4_step6
  460.     # 清除强制行动对像的战斗者
  461.     $game_temp.forcing_battler = nil
  462.     # 公共事件 ID 有效的情况下
  463.     if @common_event_id > 0
  464.       # 设置事件
  465.       common_event = $data_common_events[@common_event_id]
  466.       $game_system.battle_interpreter.setup(common_event.list, 0)
  467.     end
  468.     # 移至步骤 1
  469.     @phase4_step = 1
  470.   end
  471. end
复制代码

点评

技能设置为单体攻击 状态21 技能57 触发传递 21 57 自己修改 直接插入到main前  发表于 2012-9-27 18:56
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
43 小时
注册时间
2012-9-8
帖子
38
5
 楼主| 发表于 2012-9-29 22:49:20 | 只看该作者
yagami 发表于 2012-9-27 18:55

对不起没看懂……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
43 小时
注册时间
2012-9-8
帖子
38
6
 楼主| 发表于 2012-9-30 23:48:57 | 只看该作者
yagami 发表于 2012-9-27 18:55

看了好久
你这个和把Scene_Battle 4复制给我有什么区别
我眼拙啦看不出来!{:2_270:}

点评

至于 如何修改 是你的事情了 我只给你基本思路 这个效果要完成难度不高 你既然要学脚本就当练练手  发表于 2012-9-30 23:55
自己找21 这个数字 还有 把 随便敌人 或是自己 加上21状态 用57号技能打打看 随便打哪个 带21状态的都受到伤害 也就是铁索连环  发表于 2012-9-30 23:54
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
43 小时
注册时间
2012-9-8
帖子
38
7
 楼主| 发表于 2012-10-1 21:48:30 | 只看该作者
yagami 发表于 2012-9-27 18:55

非常非常感谢你做了这些,但是我想问一下
1、是否只有那一段有效,我可以直接插入到Scene_Battle 4之中?
2、能不能做出由属性伤害触发铁锁而不是用技能出发铁锁,因为我的火杀是由普通攻击+炎属性做成的。
3、如果2不能做到,那能不能插入多个技能触发啊……毕竟属性的技能不止一个……
{:2_270:}非常非常麻烦你了!!!!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3444
在线时间
3054 小时
注册时间
2011-11-17
帖子
980
8
发表于 2012-10-1 22:15:47 | 只看该作者
  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.   # ● 生成基本行动结果
  179.   #--------------------------------------------------------------------------
  180.   def make_basic_action_result
  181.     # 攻击的情况下
  182.     if @active_battler.current_action.basic == 0
  183.       # 设置攻击 ID
  184.       @animation1_id = @active_battler.animation1_id
  185.       @animation2_id = @active_battler.animation2_id
  186.       # 行动方的战斗者是敌人的情况下
  187.       if @active_battler.is_a?(Game_Enemy)
  188.         if @active_battler.restriction == 3
  189.           target = $game_troop.random_target_enemy
  190.         elsif @active_battler.restriction == 2
  191.           target = $game_party.random_target_actor
  192.         else
  193.           index = @active_battler.current_action.target_index
  194.           target = $game_party.smooth_target_actor(index)
  195.         end
  196.       end
  197.       # 行动方的战斗者是角色的情况下
  198.       if @active_battler.is_a?(Game_Actor)
  199.         if @active_battler.restriction == 3
  200.           target = $game_party.random_target_actor
  201.         elsif @active_battler.restriction == 2
  202.           target = $game_troop.random_target_enemy
  203.         else
  204.           index = @active_battler.current_action.target_index
  205.           target = $game_troop.smooth_target_enemy(index)
  206.         end
  207.       end
  208.       # 设置对像方的战斗者序列
  209.       @target_battlers = [target]
  210.       # 应用通常攻击效果
  211.       for target in @target_battlers
  212.         target.attack_effect(@active_battler)
  213.       end
  214.       return
  215.     end
  216.     # 防御的情况下
  217.     if @active_battler.current_action.basic == 1
  218.       # 帮助窗口显示"防御"
  219.       @help_window.set_text($data_system.words.guard, 1)
  220.       return
  221.     end
  222.     # 逃跑的情况下
  223.     if @active_battler.is_a?(Game_Enemy) and
  224.        @active_battler.current_action.basic == 2
  225.       #  帮助窗口显示"逃跑"
  226.       @help_window.set_text("逃跑", 1)
  227.       # 逃跑
  228.       @active_battler.escape
  229.       return
  230.     end
  231.     # 什么也不做的情况下
  232.     if @active_battler.current_action.basic == 3
  233.       # 清除强制行动对像的战斗者
  234.       $game_temp.forcing_battler = nil
  235.       # 移至步骤 1
  236.       @phase4_step = 1
  237.       return
  238.     end
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● 设置物品或特技对像方的战斗者
  242.   #     scope : 特技或者是物品的范围
  243.   #--------------------------------------------------------------------------
  244.   def set_target_battlers(scope)
  245.     # 行动方的战斗者是敌人的情况下
  246.     if @active_battler.is_a?(Game_Enemy)
  247.       # 效果范围分支
  248.       case scope
  249.       ################修改开始#############
  250.       when 1  # 敌单体
  251.         index = @active_battler.current_action.target_index
  252.         if $game_party.smooth_target_actor(index).states.include?(21) and @skill.element_set.include?(30)
  253.           for actor in $game_party.actors
  254.            @target_battlers.push(actor) if actor.exist? and actor.states.include?(21)
  255.            actor.remove_state(21)#####解除状态
  256.           end
  257.          for enemy in $game_troop.enemies
  258.             @target_battlers.push(enemy) if enemy.exist? and enemy.states.include?(21)
  259.             enemy.remove_state(21)#####解除状态
  260.         end
  261.           else
  262.         @target_battlers.push($game_party.smooth_target_actor(index))
  263.         end
  264.         ###############修改结束############
  265.         
  266.       when 2  # 敌全体
  267.         for actor in $game_party.actors
  268.           if actor.exist?
  269.             @target_battlers.push(actor)
  270.           end
  271.         end
  272.       when 3  # 我方单体
  273.         index = @active_battler.current_action.target_index
  274.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  275.       when 4  # 我方全体
  276.         for enemy in $game_troop.enemies
  277.           if enemy.exist?
  278.             @target_battlers.push(enemy)
  279.           end
  280.         end
  281.       when 5  # 我方单体 (HP 0)
  282.         index = @active_battler.current_action.target_index
  283.         enemy = $game_troop.enemies[index]
  284.         if enemy != nil and enemy.hp0?
  285.           @target_battlers.push(enemy)
  286.         end
  287.       when 6  # 我方全体 (HP 0)
  288.         for enemy in $game_troop.enemies
  289.           if enemy != nil and enemy.hp0?
  290.             @target_battlers.push(enemy)
  291.           end
  292.         end
  293.       when 7  # 使用者
  294.         @target_battlers.push(@active_battler)
  295.       end
  296.     end
  297.     # 行动方的战斗者是角色的情况下
  298.     if @active_battler.is_a?(Game_Actor)
  299.       
  300.       
  301.       #############################修改开始###############
  302.       # 效果范围分支
  303.       case scope
  304.       when 1  # 敌单体
  305.         index = @active_battler.current_action.target_index
  306.            if $game_troop.smooth_target_enemy(index).states.include?(21) and @skill.element_set.include?(30)
  307.           for actor in $game_party.actors
  308.            @target_battlers.push(actor) if actor.exist? and actor.states.include?(21)
  309.             actor.remove_state(21)#####解除状态
  310.           end
  311.          for enemy in $game_troop.enemies
  312.             @target_battlers.push(enemy) if enemy.exist? and enemy.states.include?(21)
  313.              enemy.remove_state(21)#####解除状态
  314.         end
  315.         else
  316.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  317.       end
  318.       ####################修改结束#########################
  319.       when 2  # 敌全体
  320.         for enemy in $game_troop.enemies
  321.           if enemy.exist?
  322.             @target_battlers.push(enemy)
  323.           end
  324.         end
  325.       when 3  # 我方单体
  326.         index = @active_battler.current_action.target_index
  327.         @target_battlers.push($game_party.smooth_target_actor(index))
  328.       when 4  # 我方全体
  329.         for actor in $game_party.actors
  330.           if actor.exist?
  331.             @target_battlers.push(actor)
  332.           end
  333.         end
  334.       when 5  # 我方单体 (HP 0)
  335.         index = @active_battler.current_action.target_index
  336.         actor = $game_party.actors[index]
  337.         if actor != nil and actor.hp0?
  338.           @target_battlers.push(actor)
  339.         end
  340.       when 6  # 我方全体 (HP 0)
  341.         for actor in $game_party.actors
  342.           if actor != nil and actor.hp0?
  343.             @target_battlers.push(actor)
  344.           end
  345.         end
  346.       when 7  # 使用者
  347.         @target_battlers.push(@active_battler)
  348.       end
  349.     end
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● 生成特技行动结果
  353.   #--------------------------------------------------------------------------
  354.   def make_skill_action_result
  355.     # 获取特技
  356.     @skill = $data_skills[@active_battler.current_action.skill_id]
  357.     # 如果不是强制行动
  358.     unless @active_battler.current_action.forcing
  359.       # 因为 SP 耗尽而无法使用的情况下
  360.       unless @active_battler.skill_can_use?(@skill.id)
  361.         # 清除强制行动对像的战斗者
  362.         $game_temp.forcing_battler = nil
  363.         # 移至步骤 1
  364.         @phase4_step = 1
  365.         return
  366.       end
  367.     end
  368.     # 消耗 SP
  369.     @active_battler.sp -= @skill.sp_cost
  370.     # 刷新状态窗口
  371.     @status_window.refresh
  372.     # 在帮助窗口显示特技名
  373.     @help_window.set_text(@skill.name, 1)
  374.     # 设置动画 ID
  375.     @animation1_id = @skill.animation1_id
  376.     @animation2_id = @skill.animation2_id
  377.     # 设置公共事件 ID
  378.     @common_event_id = @skill.common_event_id
  379.     # 设置对像侧战斗者
  380.     set_target_battlers(@skill.scope)
  381.     # 应用特技效果
  382.     for target in @target_battlers
  383.       target.skill_effect(@active_battler, @skill)
  384.     end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● 生成物品行动结果
  388.   #--------------------------------------------------------------------------
  389.   def make_item_action_result
  390.     # 获取物品
  391.     @item = $data_items[@active_battler.current_action.item_id]
  392.     # 因为物品耗尽而无法使用的情况下
  393.     unless $game_party.item_can_use?(@item.id)
  394.       # 移至步骤 1
  395.       @phase4_step = 1
  396.       return
  397.     end
  398.     # 消耗品的情况下
  399.     if @item.consumable
  400.       # 使用的物品减 1
  401.       $game_party.lose_item(@item.id, 1)
  402.     end
  403.     # 在帮助窗口显示物品名
  404.     @help_window.set_text(@item.name, 1)
  405.     # 设置动画 ID
  406.     @animation1_id = @item.animation1_id
  407.     @animation2_id = @item.animation2_id
  408.     # 设置公共事件 ID
  409.     @common_event_id = @item.common_event_id
  410.     # 确定对像
  411.     index = @active_battler.current_action.target_index
  412.     target = $game_party.smooth_target_actor(index)
  413.     # 设置对像侧战斗者
  414.     set_target_battlers(@item.scope)
  415.     # 应用物品效果
  416.     for target in @target_battlers
  417.       target.item_effect(@item)
  418.     end
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  422.   #--------------------------------------------------------------------------
  423.   def update_phase4_step3
  424.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  425.     if @animation1_id == 0
  426.       @active_battler.white_flash = true
  427.     else
  428.       @active_battler.animation_id = @animation1_id
  429.       @active_battler.animation_hit = true
  430.     end
  431.     # 移至步骤 4
  432.     @phase4_step = 4
  433.   end
  434.   #--------------------------------------------------------------------------
  435.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  436.   #--------------------------------------------------------------------------
  437.   def update_phase4_step4
  438.     # 对像方动画
  439.     for target in @target_battlers
  440.       target.animation_id = @animation2_id
  441.       target.animation_hit = (target.damage != "Miss")
  442.     end
  443.     # 限制动画长度、最低 8 帧
  444.     @wait_count = 8
  445.     # 移至步骤 5
  446.     @phase4_step = 5
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  450.   #--------------------------------------------------------------------------
  451.   def update_phase4_step5
  452.     # 隐藏帮助窗口
  453.     @help_window.visible = false
  454.     # 刷新状态窗口
  455.     @status_window.refresh
  456.     # 显示伤害
  457.     for target in @target_battlers
  458.       if target.damage != nil
  459.         target.damage_pop = true
  460.       end
  461.     end
  462.     # 移至步骤 6
  463.     @phase4_step = 6
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # ● 刷新画面 (主回合步骤 6 : 刷新)
  467.   #--------------------------------------------------------------------------
  468.   def update_phase4_step6
  469.     # 清除强制行动对像的战斗者
  470.     $game_temp.forcing_battler = nil
  471.     # 公共事件 ID 有效的情况下
  472.     if @common_event_id > 0
  473.       # 设置事件
  474.       common_event = $data_common_events[@common_event_id]
  475.       $game_system.battle_interpreter.setup(common_event.list, 0)
  476.     end
  477.     # 移至步骤 1
  478.     @phase4_step = 1
  479.   end
  480. end
复制代码

点评

因为你的帖子没发悬赏 所以无法认可的 没事,经验神马都是浮云- -  发表于 2012-10-2 22:31
找不到认可答案这个键了、被吃掉了吗  发表于 2012-10-2 19:10
谢谢  发表于 2012-10-2 19:03
修改位置已经注明了 自己整合到Scene_Battle 4里去 整合应该不用教了吧  发表于 2012-10-1 22:19
我现在设置 铁索状态21 技能勾选属性30 触发i连锁 21 30 自己改 顺便帮加入了 铁索连环 受到伤害后 铁索解除 应该完美了。。。  发表于 2012-10-1 22:17

评分

参与人数 1梦石 +2 收起 理由
hcm + 2 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
43 小时
注册时间
2012-9-8
帖子
38
9
 楼主| 发表于 2012-10-2 19:00:23 | 只看该作者
yagami 发表于 2012-10-1 22:15

超棒的、不过我发现群体属性伤害不能让铁锁消失
不过也好了、谢谢你 了{:2_287:}
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 08:05

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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