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

Project1

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

[已经过期] RTAB战斗系统如何做一个技能3体或者4体的效果

[复制链接]

Lv2.观梦者

梦石
0
星屑
596
在线时间
797 小时
注册时间
2014-7-1
帖子
578

开拓者

跳转到指定楼层
1
发表于 2017-2-27 18:37:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 jiushiainilip19 于 2017-2-28 12:02 编辑

发了2个帖子 不好意思,下面那个帖子代码忘记分开了 导致4千多行在一起 帖子都爆了
还请版本删除一下,sorry!!!!!!!!!!!!!!!!!

如题所示的功能,下面是RTAB初版[XP图书馆中那个RTAB]中对技能的描述代码 。 就想用这个版本 豪华版太晕了 看不懂

RUBY 代码复制
  1. def set_target_battlers(scope, battler)
  2.     # 行動側バトラーがエネミーの場合
  3.     if battler.is_a?(Game_Enemy)
  4.       # 効果範囲で分岐
  5.       case scope
  6.       when 1  # 敵単体
  7.         index =battler.current_action.target_index
  8.         battler.target.push($game_party.smooth_target_actor(index))
  9.       when 2  # 敵全体
  10.         for actor in $game_party.actors
  11.           if actor.exist?
  12.             battler.target.push(actor)
  13.           end
  14.         end
  15.       when 3  # 味方単体
  16.         index = battler.current_action.target_index
  17.         battler.target.push($game_troop.smooth_target_enemy(index))
  18.       when 4  # 味方全体
  19.         for enemy in $game_troop.enemies
  20.           if enemy.exist?
  21.             battler.target.push(enemy)
  22.           end
  23.         end
  24.       when 5  # 味方単体 (HP 0)
  25.         index = battler.current_action.target_index
  26.         enemy = $game_troop.enemies[index]
  27.         if enemy != nil and enemy.hp0?
  28.           battler.target.push(enemy)
  29.         end
  30.       when 6  # 味方全体 (HP 0)
  31.         for enemy in $game_troop.enemies
  32.           if enemy != nil and enemy.hp0?
  33.             battler.target.push(enemy)
  34.           end
  35.         end
  36.       when 7  # 使用者
  37.         battler.target.push(battler)
  38.  
  39.       end
  40.     end
  41.     # 行動側バトラーがアクターの場合
  42.     if battler.is_a?(Game_Actor)
  43.       # 効果範囲で分岐
  44.       case scope
  45.       when 1  # 敵単体
  46.         index = battler.current_action.target_index
  47.         battler.target.push($game_troop.smooth_target_enemy(index))
  48.       when 2  # 敵全体
  49.         for enemy in $game_troop.enemies
  50.           if enemy.exist?
  51.             battler.target.push(enemy)
  52.           end
  53.         end
  54.       when 3  # 味方単体
  55.         index = battler.current_action.target_index
  56.         battler.target.push($game_party.smooth_target_actor(index))
  57.       when 4  # 味方全体
  58.         for actor in $game_party.actors
  59.           if actor.exist?
  60.             battler.target.push(actor)
  61.           end
  62.         end
  63.       when 5  # 味方単体 (HP 0)
  64.         index = battler.current_action.target_index
  65.         actor = $game_party.actors[index]
  66.         if actor != nil and actor.hp0?
  67.           battler.target.push(actor)
  68.         end
  69.       when 6  # 味方全体 (HP 0)
  70.         for actor in $game_party.actors
  71.           if actor != nil and actor.hp0?
  72.             battler.target.push(actor)
  73.           end
  74.         end
  75.       when 7  # 使用者
  76.         battler.target.push(battler)
  77. #=========================
  78.           #2体攻击 如果换成3 或4体 可以把下面带#号的地方改成3和4
  79.       when 10
  80.         date = []
  81.         if R_TWO_SKILL_ID.include?(skill.id)   #随机4体
  82.           for enemy in $game_troop.enemies
  83.             if enemy.exist?
  84.               date.push(enemy)
  85.             end
  86.           end
  87.           if date.size >= 2# 手动更改
  88.            loop do
  89.              break if battler.target.size >= 2# 手动更改
  90.              target = date[rand (date.size)]
  91.              if not battler.target.include?(target)
  92.                battler.target.push(target)
  93.              end
  94.            end
  95.           else
  96.             for target in date
  97.               battler.target.push(target)
  98.             end
  99.           end
  100.         end
  101. #=========================
  102.  
  103.  
  104.       end
  105.     end
  106.   end
  107. #=====================
  108. #然后在下面在添加技能的@skill.scope范围
  109. def make_skill_action_result(battler)
  110.     # スキルを取得
  111.     @skill = $data_skills[battler.current_action.skill_id]
  112.     # 連携スキルであるかどうか確認
  113.     speller = synthe?(battler)
  114.     # 強制アクションでなければ
  115.     unless battler.current_action.forcing
  116.       # SP 切れなどで使用できなくなった場合
  117.       if speller == nil
  118.         unless battler.skill_can_use?(@skill.id)
  119.           # ステップ 6 に移行
  120.           battler.phase = 6
  121.          return
  122.         end
  123.       end
  124.     end
  125.     # SP 消費
  126.     temp = false
  127.     if speller != nil
  128.       for spell in speller
  129.         if spell.current_action.spell_id == 0
  130.           spell.sp -= @skill.sp_cost
  131.         else
  132.           spell.sp -= $data_skills[spell.current_action.spell_id].sp_cost
  133.         end
  134.         # ステータスウィンドウをリフレッシュ
  135.         status_refresh(spell)
  136.       end
  137.     else
  138.       battler.sp -= @skill.sp_cost
  139.       # ステータスウィンドウをリフレッシュ
  140.       status_refresh(battler)
  141.     end
  142.     # アニメーション ID を設定
  143.     battler.anime1 = @skill.animation1_id
  144.     battler.anime2 = @skill.animation2_id
  145.     # コモンイベント ID を設定
  146.     battler.event = @skill.common_event_id
  147.     #===========================
  148.     #技能多体
  149.     #令狐冲+九剑归一
  150.     if @skill.id == 603
  151.       @skill.scope = 10
  152.     end
  153.  
  154.     # 対象側バトラーを設定
  155.     set_target_battlers(@skill.scope, battler)
  156. #====================================
  157. #下面省略 都是原脚本
  158. #====================

点评

解决方案是利用芯大的多体效果进行对应的更改的,喜欢的拿去用吧!  发表于 2017-2-28 12:03
已经解决了!劳烦版本大大结下帖子!  发表于 2017-2-28 11:57
学习使我疲劳,打工使我疲惫,恋爱使我伤身,吸烟伤我肺腑,饮酒损我形象,旅游使我破费,月底不见铜板,只有在论坛里面看看各种大佬才能使我进去
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-9-21 20:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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