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

Project1

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

[已经解决] 求助!技能问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
215
在线时间
209 小时
注册时间
2015-8-11
帖子
110
跳转到指定楼层
1
发表于 2015-8-12 11:13:52 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如何让XP的人物发动技能的同时说出些话来,像VX的那样

Lv1.梦旅人

梦石
0
星屑
50
在线时间
33 小时
注册时间
2015-7-4
帖子
27
2
发表于 2015-8-12 12:02:18 | 只看该作者
可以在数据库—特技的“公示事件”设置
首先创建一个新的公共事件,目标无,名字随意,然后显示文章打上要说的话,再在特技—公共事件中选择这个公共事件即可
只不过这样做出来效果是特技发动完才会显示
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
215
在线时间
209 小时
注册时间
2015-8-11
帖子
110
3
 楼主| 发表于 2015-8-12 19:53:43 | 只看该作者
亡灵史莱姆 发表于 2015-8-12 12:02
可以在数据库—特技的“公示事件”设置
首先创建一个新的公共事件,目标无,名字随意,然后显示文章打上要 ...

3Q!但是本方法已会。怎么在发动之前说呢??

点评

战斗的脚本,应用技能效果 的部分,在后面才会触发公共事件。所以,可以在应用技能效果之前插入公共事件的部分,把后面的删掉,这样就OK了。  发表于 2015-8-12 22:21
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
33 小时
注册时间
2015-7-4
帖子
27
4
发表于 2015-8-12 21:48:23 | 只看该作者
2283522939 发表于 2015-8-12 19:53
3Q!但是本方法已会。怎么在发动之前说呢??

技术有限,无法解答,抱歉……{:2_271:}
回复 支持 反对

使用道具 举报

Lv3.寻梦者

小空格

梦石
0
星屑
2595
在线时间
551 小时
注册时间
2009-7-15
帖子
1107
5
发表于 2015-8-12 22:44:22 | 只看该作者
替换Scene_Battle 4

RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_Battle (分割定义 4)
  3. #------------------------------------------------------------------------------
  4. #  处理战斗画面的类。
  5. #==============================================================================
  6.  
  7. class Scene_Battle
  8.   #--------------------------------------------------------------------------
  9.   # ● 开始主回合
  10.   #--------------------------------------------------------------------------
  11.   def start_phase4
  12.     # 转移到回合 4
  13.     @phase = 4
  14.     # 回合数计数
  15.     $game_temp.battle_turn += 1
  16.     # 搜索全页的战斗事件
  17.     for index in 0...$data_troops[@troop_id].pages.size
  18.       # 获取事件页
  19.       page = $data_troops[@troop_id].pages[index]
  20.       # 本页的范围是 [回合] 的情况下
  21.       if page.span == 1
  22.         # 设置已经执行标志
  23.         $game_temp.battle_event_flags[index] = false
  24.       end
  25.     end
  26.     # 设置角色为非选择状态
  27.     @actor_index = -1
  28.     @active_battler = nil
  29.     # 有效化同伴指令窗口
  30.     @party_command_window.active = false
  31.     @party_command_window.visible = false
  32.     # 无效化角色指令窗口
  33.     @actor_command_window.active = false
  34.     @actor_command_window.visible = false
  35.     # 设置主回合标志
  36.     $game_temp.battle_main_phase = true
  37.     # 生成敌人行动
  38.     for enemy in $game_troop.enemies
  39.       enemy.make_action
  40.     end
  41.     # 生成行动顺序
  42.     make_action_orders
  43.     # 移动到步骤 1
  44.     @phase4_step = 1
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 生成行动循序
  48.   #--------------------------------------------------------------------------
  49.   def make_action_orders
  50.     # 初始化序列 @action_battlers
  51.     @action_battlers = []
  52.     # 添加敌人到 @action_battlers 序列
  53.     for enemy in $game_troop.enemies
  54.       @action_battlers.push(enemy)
  55.     end
  56.     # 添加角色到 @action_battlers 序列
  57.     for actor in $game_party.actors
  58.       @action_battlers.push(actor)
  59.     end
  60.     # 确定全体的行动速度
  61.     for battler in @action_battlers
  62.       battler.make_action_speed
  63.     end
  64.     # 按照行动速度从大到小排列
  65.     @action_battlers.sort! {|a,b|
  66.       b.current_action.speed - a.current_action.speed }
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● 刷新画面 (主回合)
  70.   #--------------------------------------------------------------------------
  71.   def update_phase4
  72.     case @phase4_step
  73.     when 1
  74.       update_phase4_step1
  75.     when 2
  76.       update_phase4_step2
  77.     when 3
  78.       update_phase4_step3
  79.     when 4
  80.       update_phase4_step4
  81.     when 5
  82.       update_phase4_step5
  83.     when 6
  84.       update_phase4_step6
  85.     end
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 刷新画面 (主回合步骤 1 : 准备行动)
  89.   #--------------------------------------------------------------------------
  90.   def update_phase4_step1
  91.     # 隐藏帮助窗口
  92.     @help_window.visible = false
  93.     # 判定胜败
  94.     if judge
  95.       # 胜利或者失败的情况下 : 过程结束
  96.       return
  97.     end
  98.     # 强制行动的战斗者不存在的情况下
  99.     if $game_temp.forcing_battler == nil
  100.       # 设置战斗事件
  101.       setup_battle_event
  102.       # 执行战斗事件中的情况下
  103.       if $game_system.battle_interpreter.running?
  104.         return
  105.       end
  106.     end
  107.     # 强制行动的战斗者存在的情况下
  108.     if $game_temp.forcing_battler != nil
  109.       # 在头部添加后移动
  110.       @action_battlers.delete($game_temp.forcing_battler)
  111.       @action_battlers.unshift($game_temp.forcing_battler)
  112.     end
  113.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  114.     if @action_battlers.size == 0
  115.       # 开始同伴命令回合
  116.       start_phase2
  117.       return
  118.     end
  119.     # 初始化动画 ID 和公共事件 ID
  120.     @animation1_id = 0
  121.     @animation2_id = 0
  122.     @common_event_id = 0
  123.     # 未行动的战斗者移动到序列的头部
  124.     @active_battler = @action_battlers.shift
  125.     # 如果已经在战斗之外的情况下
  126.     if @active_battler.index == nil
  127.       return
  128.     end
  129.     # 连续伤害
  130.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  131.       @active_battler.slip_damage_effect
  132.       @active_battler.damage_pop = true
  133.     end
  134.     # 自然解除状态
  135.     @active_battler.remove_states_auto
  136.     # 刷新状态窗口
  137.     @status_window.refresh
  138.     # 移至步骤 2
  139.     @phase4_step = 2
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 刷新画面 (主回合步骤 2 : 开始行动)
  143.   #--------------------------------------------------------------------------
  144.   def update_phase4_step2
  145.     # 如果不是强制行动
  146.     unless @active_battler.current_action.forcing
  147.       # 限制为 [敌人为普通攻击] 或 [我方为普通攻击] 的情况下
  148.       if @active_battler.restriction == 2 or @active_battler.restriction == 3
  149.         # 设置行动为攻击
  150.         @active_battler.current_action.kind = 0
  151.         @active_battler.current_action.basic = 0
  152.       end
  153.       # 限制为 [不能行动] 的情况下
  154.       if @active_battler.restriction == 4
  155.         # 清除行动强制对像的战斗者
  156.         $game_temp.forcing_battler = nil
  157.         # 移至步骤 1
  158.         @phase4_step = 1
  159.         return
  160.       end
  161.     end
  162.     # 清除对像战斗者
  163.     @target_battlers = []
  164.     # 行动种类分支
  165.     case @active_battler.current_action.kind
  166.     when 0  # 基本
  167.       make_basic_action_result
  168.     when 1  # 特技
  169.       make_skill_action_result
  170.     when 2  # 物品
  171.       make_item_action_result
  172.     end
  173.     # 移至步骤 3
  174.     if @phase4_step == 2
  175.       @phase4_step = 3
  176.     end
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● 生成基本行动结果
  180.   #--------------------------------------------------------------------------
  181.   def make_basic_action_result
  182.     # 攻击的情况下
  183.     if @active_battler.current_action.basic == 0
  184.       # 设置攻击 ID
  185.       @animation1_id = @active_battler.animation1_id
  186.       @animation2_id = @active_battler.animation2_id
  187.       # 行动方的战斗者是敌人的情况下
  188.       if @active_battler.is_a?(Game_Enemy)
  189.         if @active_battler.restriction == 3
  190.           target = $game_troop.random_target_enemy
  191.         elsif @active_battler.restriction == 2
  192.           target = $game_party.random_target_actor
  193.         else
  194.           index = @active_battler.current_action.target_index
  195.           target = $game_party.smooth_target_actor(index)
  196.         end
  197.       end
  198.       # 行动方的战斗者是角色的情况下
  199.       if @active_battler.is_a?(Game_Actor)
  200.         if @active_battler.restriction == 3
  201.           target = $game_party.random_target_actor
  202.         elsif @active_battler.restriction == 2
  203.           target = $game_troop.random_target_enemy
  204.         else
  205.           index = @active_battler.current_action.target_index
  206.           target = $game_troop.smooth_target_enemy(index)
  207.         end
  208.       end
  209.       # 设置对像方的战斗者序列
  210.       @target_battlers = [target]
  211.       # 应用通常攻击效果
  212.       for target in @target_battlers
  213.         target.attack_effect(@active_battler)
  214.       end
  215.       return
  216.     end
  217.     # 防御的情况下
  218.     if @active_battler.current_action.basic == 1
  219.       # 帮助窗口显示"防御"
  220.       @help_window.set_text($data_system.words.guard, 1)
  221.       return
  222.     end
  223.     # 逃跑的情况下
  224.     if @active_battler.is_a?(Game_Enemy) and
  225.        @active_battler.current_action.basic == 2
  226.       #  帮助窗口显示"逃跑"
  227.       @help_window.set_text("逃跑", 1)
  228.       # 逃跑
  229.       @active_battler.escape
  230.       return
  231.     end
  232.     # 什么也不做的情况下
  233.     if @active_battler.current_action.basic == 3
  234.       # 清除强制行动对像的战斗者
  235.       $game_temp.forcing_battler = nil
  236.       # 移至步骤 1
  237.       @phase4_step = 1
  238.       return
  239.     end
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● 设置物品或特技对像方的战斗者
  243.   #     scope : 特技或者是物品的范围
  244.   #--------------------------------------------------------------------------
  245.   def set_target_battlers(scope)
  246.     # 行动方的战斗者是敌人的情况下
  247.     if @active_battler.is_a?(Game_Enemy)
  248.       # 效果范围分支
  249.       case scope
  250.       when 1  # 敌单体
  251.         index = @active_battler.current_action.target_index
  252.         @target_battlers.push($game_party.smooth_target_actor(index))
  253.       when 2  # 敌全体
  254.         for actor in $game_party.actors
  255.           if actor.exist?
  256.             @target_battlers.push(actor)
  257.           end
  258.         end
  259.       when 3  # 我方单体
  260.         index = @active_battler.current_action.target_index
  261.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  262.       when 4  # 我方全体
  263.         for enemy in $game_troop.enemies
  264.           if enemy.exist?
  265.             @target_battlers.push(enemy)
  266.           end
  267.         end
  268.       when 5  # 我方单体 (HP 0)
  269.         index = @active_battler.current_action.target_index
  270.         enemy = $game_troop.enemies[index]
  271.         if enemy != nil and enemy.hp0?
  272.           @target_battlers.push(enemy)
  273.         end
  274.       when 6  # 我方全体 (HP 0)
  275.         for enemy in $game_troop.enemies
  276.           if enemy != nil and enemy.hp0?
  277.             @target_battlers.push(enemy)
  278.           end
  279.         end
  280.       when 7  # 使用者
  281.         @target_battlers.push(@active_battler)
  282.       end
  283.     end
  284.     # 行动方的战斗者是角色的情况下
  285.     if @active_battler.is_a?(Game_Actor)
  286.       # 效果范围分支
  287.       case scope
  288.       when 1  # 敌单体
  289.         index = @active_battler.current_action.target_index
  290.         @target_battlers.push($game_troop.smooth_target_enemy(index))
  291.       when 2  # 敌全体
  292.         for enemy in $game_troop.enemies
  293.           if enemy.exist?
  294.             @target_battlers.push(enemy)
  295.           end
  296.         end
  297.       when 3  # 我方单体
  298.         index = @active_battler.current_action.target_index
  299.         @target_battlers.push($game_party.smooth_target_actor(index))
  300.       when 4  # 我方全体
  301.         for actor in $game_party.actors
  302.           if actor.exist?
  303.             @target_battlers.push(actor)
  304.           end
  305.         end
  306.       when 5  # 我方单体 (HP 0)
  307.         index = @active_battler.current_action.target_index
  308.         actor = $game_party.actors[index]
  309.         if actor != nil and actor.hp0?
  310.           @target_battlers.push(actor)
  311.         end
  312.       when 6  # 我方全体 (HP 0)
  313.         for actor in $game_party.actors
  314.           if actor != nil and actor.hp0?
  315.             @target_battlers.push(actor)
  316.           end
  317.         end
  318.       when 7  # 使用者
  319.         @target_battlers.push(@active_battler)
  320.       end
  321.     end
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● 生成特技行动结果
  325.   #--------------------------------------------------------------------------
  326.   def make_skill_action_result
  327.     # 获取特技
  328.     @skill = $data_skills[@active_battler.current_action.skill_id]
  329.     # 如果不是强制行动
  330.     unless @active_battler.current_action.forcing
  331.       # 因为 SP 耗尽而无法使用的情况下
  332.       unless @active_battler.skill_can_use?(@skill.id)
  333.         # 清除强制行动对像的战斗者
  334.         $game_temp.forcing_battler = nil
  335.         # 移至步骤 1
  336.         @phase4_step = 1
  337.         return
  338.       end
  339.     end
  340.     # 消耗 SP
  341.     @active_battler.sp -= @skill.sp_cost
  342.     # 刷新状态窗口
  343.     @status_window.refresh
  344.     # 在帮助窗口显示特技名
  345.     @help_window.set_text(@skill.name, 1)
  346.     # 设置动画 ID
  347.     @animation1_id = @skill.animation1_id
  348.     @animation2_id = @skill.animation2_id
  349.     # 设置对像侧战斗者
  350.     set_target_battlers(@skill.scope)
  351.     # 设置公共事件 ID
  352.     @common_event_id = @skill.common_event_id
  353.     # 公共事件 ID 有效的情况下
  354.     if @common_event_id > 0
  355.       # 设置事件
  356.       common_event = $data_common_events[@common_event_id]
  357.       $game_system.battle_interpreter.setup(common_event.list, 0)
  358.     end
  359.     # 应用特技效果
  360.     for target in @target_battlers
  361.       target.skill_effect(@active_battler, @skill)
  362.     end
  363.   end
  364.   #--------------------------------------------------------------------------
  365.   # ● 生成物品行动结果
  366.   #--------------------------------------------------------------------------
  367.   def make_item_action_result
  368.     # 获取物品
  369.     @item = $data_items[@active_battler.current_action.item_id]
  370.     # 因为物品耗尽而无法使用的情况下
  371.     unless $game_party.item_can_use?(@item.id)
  372.       # 移至步骤 1
  373.       @phase4_step = 1
  374.       return
  375.     end
  376.     # 消耗品的情况下
  377.     if @item.consumable
  378.       # 使用的物品减 1
  379.       $game_party.lose_item(@item.id, 1)
  380.     end
  381.     # 在帮助窗口显示物品名
  382.     @help_window.set_text(@item.name, 1)
  383.     # 设置动画 ID
  384.     @animation1_id = @item.animation1_id
  385.     @animation2_id = @item.animation2_id
  386.     # 设置公共事件 ID
  387.     @common_event_id = @item.common_event_id
  388.     # 确定对像
  389.     index = @active_battler.current_action.target_index
  390.     target = $game_party.smooth_target_actor(index)
  391.     # 设置对像侧战斗者
  392.     set_target_battlers(@item.scope)
  393.     # 应用物品效果
  394.     for target in @target_battlers
  395.       target.item_effect(@item)
  396.     end
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ● 刷新画面 (主回合步骤 3 : 行动方动画)
  400.   #--------------------------------------------------------------------------
  401.   def update_phase4_step3
  402.     # 行动方动画 (ID 为 0 的情况下是白色闪烁)
  403.     if @animation1_id == 0
  404.       @active_battler.white_flash = true
  405.     else
  406.       @active_battler.animation_id = @animation1_id
  407.       @active_battler.animation_hit = true
  408.     end
  409.     # 移至步骤 4
  410.     @phase4_step = 4
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  414.   #--------------------------------------------------------------------------
  415.   def update_phase4_step4
  416.     # 对像方动画
  417.     for target in @target_battlers
  418.       target.animation_id = @animation2_id
  419.       target.animation_hit = (target.damage != "Miss")
  420.     end
  421.     # 限制动画长度、最低 8 帧
  422.     @wait_count = 8
  423.     # 移至步骤 5
  424.     @phase4_step = 5
  425.   end
  426.   #--------------------------------------------------------------------------
  427.   # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  428.   #--------------------------------------------------------------------------
  429.   def update_phase4_step5
  430.     # 隐藏帮助窗口
  431.     @help_window.visible = false
  432.     # 刷新状态窗口
  433.     @status_window.refresh
  434.     # 显示伤害
  435.     for target in @target_battlers
  436.       if target.damage != nil
  437.         target.damage_pop = true
  438.       end
  439.     end
  440.     # 移至步骤 6
  441.     @phase4_step = 6
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● 刷新画面 (主回合步骤 6 : 刷新)
  445.   #--------------------------------------------------------------------------
  446.   def update_phase4_step6
  447.     # 清除强制行动对像的战斗者
  448.     $game_temp.forcing_battler = nil
  449.     # 移至步骤 1
  450.     @phase4_step = 1
  451.   end
  452. end
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
215
在线时间
209 小时
注册时间
2015-8-11
帖子
110
6
 楼主| 发表于 2015-8-13 07:08:58 | 只看该作者
№独孤剑→ 发表于 2015-8-12 22:44
替换Scene_Battle 4

#==============================================================================

抱歉,新手,具体怎么用喱
回复 支持 反对

使用道具 举报

Lv3.寻梦者

小空格

梦石
0
星屑
2595
在线时间
551 小时
注册时间
2009-7-15
帖子
1107
7
发表于 2015-8-13 10:06:09 | 只看该作者
2283522939 发表于 2015-8-13 07:08
抱歉,新手,具体怎么用喱

脚本库,左边,找Scene_Battl 4 , 复制,粘贴,像楼上你学会一样.
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
215
在线时间
209 小时
注册时间
2015-8-11
帖子
110
8
 楼主| 发表于 2015-8-13 10:21:00 | 只看该作者
№独孤剑→ 发表于 2015-8-13 10:06
脚本库,左边,找Scene_Battl 4 , 复制,粘贴,像楼上你学会一样.

哦哦哦,光顾脚本了,遗忘了数据库
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
215
在线时间
209 小时
注册时间
2015-8-11
帖子
110
9
 楼主| 发表于 2015-8-13 10:32:00 | 只看该作者
№独孤剑→ 发表于 2015-8-13 10:06
脚本库,左边,找Scene_Battl 4 , 复制,粘贴,像楼上你学会一样.

没有解决完
声明  我有两个工程一个是做的,另一个是测试脚本的
当我把公共事件中插入图片的时候,他就消失了!!

点评

什么消失了?  发表于 2015-8-13 11:34
回复 支持 反对

使用道具 举报

Lv3.寻梦者

小空格

梦石
0
星屑
2595
在线时间
551 小时
注册时间
2009-7-15
帖子
1107
10
发表于 2015-8-13 11:34:33 | 只看该作者
2283522939 发表于 2015-8-13 10:32
没有解决完
声明  我有两个工程一个是做的,另一个是测试脚本的
当我把公共事件中插入图片的时候,他就消 ...

什么消失了?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-27 15:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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