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

Project1

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

[已经解决] 如何让某角色/状态下一回合可以多次进行使用道具的行动?

[复制链接]

Lv3.寻梦者

梦石
0
星屑
2323
在线时间
274 小时
注册时间
2017-7-25
帖子
163
跳转到指定楼层
1
发表于 2019-9-20 01:56:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
大佬们好,本菜鸡又来想法了
事情大概是,有一个剧情设定上比较弱的角色,我不想让他有太强的技能砍出跟主角同一梯队的爆炸伤害,但又不希望他因为战五渣永远坐冷板凳,于是想了想怎样才能让这位选手在弱的同时又有用……

废话说完了,总之求问一下,怎样让特定的角色/职业/状态下,一回合可以连续使用多个道具(类似多次行动机会,但只限于使用道具,技能还是只能放一次)
默认的药理知识貌似只增强回复效果,道具里有些更复杂的效果没有影响,也不能一回合使用多次

Lv3.寻梦者

梦石
0
星屑
1083
在线时间
140 小时
注册时间
2019-5-12
帖子
57
2
发表于 2019-9-20 20:31:38 | 只看该作者
本帖最后由 真の玛娜君 于 2019-9-20 20:43 编辑

在物品or技能 备注栏输入  <即时使用> 即可,可以不消耗回合
详情请看脚本介绍
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - 即时使用 v1.03
  4. # -- 最后更新: 2012.07.17
  5. # -- 使用难度: 普通
  6. # -- 需要脚本: 无
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-InstantCast"] = true

  11. #==============================================================================
  12. # ▼  Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.07.17 - Instant doesn't take up a turn if a characterh as additional
  15. #              actions/can attack twice.
  16. # 2012.01.12 - Anti-crash methods implemented.
  17. # 2011.12.26 - Bug Fixed: If actor gets stunned while doing an instant cast,
  18. #              the actor will not be reselected.
  19. # 2011.12.21 - Started Script and Finished.
  20. #
  21. #==============================================================================
  22. # ▼  介绍
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # 即时使用技能/物品的效果为:角色可以立即使用该技能/武器,并且不会消耗本回合的
  25. # 行动次数。只要该角色有足够的释放条件(例如mp、tp)就可以无限使用.
  26. # 即时使用功能重回RPG Maker VX Ace.以下为即时使用的一些改动:
  27. #
  28. # 1) 对于多行动数的角色,例如连续技,只有在第一个动作是即时使用时才会成功使用即
  29. #    时使用效果.就算第二个或之后的行动为即时使用,该技能也不会触发即时使用效果.
  30. #
  31. # 2) 任何即时使用的技能/物品都会自动瞬时触发,包括即时使用技能中的连锁技能.
  32. #
  33. # 3) 如果敌人使用了一个即时使用的技能,其在使用后会额为获得一次行动机会.
  34. #
  35. #==============================================================================
  36. # ▼ 安装方式
  37. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  38. # 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新
  39. # 脚本页/槽中.记得保存你的工程以使脚本生效.
  40. #
  41. # -----------------------------------------------------------------------------
  42. # 技能备注 - 在数据库-技能中可以使用的备注.
  43. # -----------------------------------------------------------------------------
  44. # <即时使用>
  45. # 使该技能变成即时使用技能.使用后在战斗阶段开始前会立即使用该技能.
  46. #
  47. # -----------------------------------------------------------------------------
  48. # 物品备注 - 在数据库-物品中可以使用的备注.
  49. # -----------------------------------------------------------------------------
  50. # <即时使用>
  51. # 使该物品变成即时使用物品.使用后在战斗阶段开始前会立即使用该技能.
  52. #
  53. #==============================================================================
  54. # ▼ 兼容性
  55. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  56. # 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX.
  57. #
  58. # 本脚本和 Yanfly Engine Ace - 战斗系统 v1.00+ 互相兼容.
  59. # 请将本脚本放在其之下.
  60. #
  61. #==============================================================================
  62. # ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭
  63. # 所以编辑了后果自负。
  64. #==============================================================================

  65. module YEA
  66.   module REGEXP
  67.   module USABLEITEM
  68.    
  69.     INSTANT = /<(?:INSTANT|即时使用)>/i
  70.    
  71.   end # USABLEITEM
  72.   end # REGEXP
  73. end # YEA

  74. #==============================================================================
  75. # ¡ DataManager
  76. #==============================================================================

  77. module DataManager
  78.   
  79.   #--------------------------------------------------------------------------
  80.   # alias method: load_database
  81.   #--------------------------------------------------------------------------
  82.   class <<self; alias load_database_instant load_database; end
  83.   def self.load_database
  84.     load_database_instant
  85.     load_notetags_instant
  86.   end
  87.   
  88.   #--------------------------------------------------------------------------
  89.   # new method: load_notetags_instant
  90.   #--------------------------------------------------------------------------
  91.   def self.load_notetags_instant
  92.     groups = [$data_skills, $data_items]
  93.     for group in groups
  94.       for obj in group
  95.         next if obj.nil?
  96.         obj.load_notetags_instant
  97.       end
  98.     end
  99.   end
  100.   
  101. end # DataManager

  102. #==============================================================================
  103. # ¡ RPG::UsableItem
  104. #==============================================================================

  105. class RPG::UsableItem < RPG::BaseItem
  106.   
  107.   #--------------------------------------------------------------------------
  108.   # public instance variables
  109.   #--------------------------------------------------------------------------
  110.   attr_accessor :instant
  111.   
  112.   #--------------------------------------------------------------------------
  113.   # common cache: load_notetags_instant
  114.   #--------------------------------------------------------------------------
  115.   def load_notetags_instant
  116.     @instant = false
  117.     #---
  118.     self.note.split(/[\r\n]+/).each { |line|
  119.       case line
  120.       #---
  121.       when YEA::REGEXP::USABLEITEM::INSTANT
  122.         @instant = true
  123.       #---
  124.       end
  125.     } # self.note.split
  126.     #---
  127.   end
  128.   
  129. end # RPG::UsableItem

  130. #==============================================================================
  131. # ¡ Game_Actor
  132. #==============================================================================

  133. class Game_Actor < Game_Battler
  134.   
  135.   #--------------------------------------------------------------------------
  136.   # new method: check_instant_action
  137.   #--------------------------------------------------------------------------
  138.   def check_instant_action
  139.     @backup_actions_instant = []
  140.     @actions.each { |action|
  141.       next unless action
  142.       if action.item.nil?
  143.         @backup_actions_instant.push(action.dup)
  144.         next
  145.       end
  146.       unless action.item.instant
  147.         @backup_actions_instant.push(action.dup)
  148.         action.clear
  149.       end
  150.     }
  151.   end
  152.   
  153.   #--------------------------------------------------------------------------
  154.   # new method: restore_instant_action
  155.   #--------------------------------------------------------------------------
  156.   def restore_instant_action
  157.     @backup_actions_instant.each_index { |i|
  158.       @actions[i] = @backup_actions_instant[i]
  159.     }
  160.     @backup_actions_instant.clear
  161.     i = 0
  162.     @actions.each { |action| if action.item.nil?; break; end; i += 1 }
  163.     @action_input_index = i
  164.   end
  165.   
  166. end # Game_Actor

  167. #==============================================================================
  168. # ¡ Game_Enemy
  169. #==============================================================================

  170. class Game_Enemy < Game_Battler
  171.   
  172.   #--------------------------------------------------------------------------
  173.   # new method: add_extra_action
  174.   #--------------------------------------------------------------------------
  175.   def add_extra_action
  176.     action_list = enemy.actions.select {|a| action_valid?(a) }
  177.     return if action_list.empty?
  178.     rating_max = action_list.collect {|a| a.rating }.max
  179.     rating_zero = rating_max - 3
  180.     action_list.reject! {|a| a.rating <= rating_zero }
  181.     action = Game_Action.new(self)
  182.     action.set_enemy_action(select_enemy_action(action_list, rating_zero))
  183.     @actions.push(action)
  184.   end
  185.   
  186. end # Game_Enemy

  187. #==============================================================================
  188. # ¡ Scene_Battle
  189. #==============================================================================

  190. class Scene_Battle < Scene_Base
  191.   
  192.   #--------------------------------------------------------------------------
  193.   # alias method: next_command
  194.   #--------------------------------------------------------------------------
  195.   alias scene_battle_next_command_instant next_command
  196.   def next_command
  197.     if instant_action?
  198.       perform_instant_action
  199.     else
  200.       scene_battle_next_command_instant
  201.     end
  202.   end
  203.   
  204.   #--------------------------------------------------------------------------
  205.   # new method: instant_action?
  206.   #--------------------------------------------------------------------------
  207.   def instant_action?
  208.     return false if BattleManager.actor.nil?
  209.     return false if BattleManager.actor.input.nil?
  210.     action = BattleManager.actor.input.item
  211.     return false if action.nil?
  212.     return action.instant
  213.   end
  214.   
  215.   #--------------------------------------------------------------------------
  216.   # new method: perform_instant_action
  217.   #--------------------------------------------------------------------------
  218.   def perform_instant_action
  219.     hide_instant_action_windows
  220.     @subject = BattleManager.actor
  221.     @subject.check_instant_action
  222.     execute_action if @subject.current_action.valid?
  223.     process_event
  224.     loop do
  225.       @subject.remove_current_action
  226.       break if $game_troop.all_dead?
  227.       break unless @subject.current_action
  228.       @subject.current_action.prepare
  229.       execute_action if @subject.current_action.valid?
  230.     end
  231.     process_action_end
  232.     @subject.make_actions
  233.     @subject.restore_instant_action
  234.     @subject = nil
  235.     show_instant_action_windows
  236.   end
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # new method: hide_instant_action_windows
  240.   #--------------------------------------------------------------------------
  241.   def hide_instant_action_windows
  242.     if $imported["YEA-BattleEngine"]
  243.       @info_viewport.visible = true
  244.       @status_aid_window.hide
  245.       @status_window.show
  246.       @actor_command_window.show
  247.     end
  248.   end
  249.   
  250.   #--------------------------------------------------------------------------
  251.   # new method: show_instant_action_windows
  252.   #--------------------------------------------------------------------------
  253.   def show_instant_action_windows
  254.     if $imported["YEA-BattleEngine"]
  255.       @info_viewport.visible = true
  256.     end
  257.     start_actor_command_selection
  258.     status_redraw_target(BattleManager.actor)
  259.     next_command unless BattleManager.actor.inputable?
  260.   end
  261.   
  262.   #--------------------------------------------------------------------------
  263.   # new method: status_redraw_target
  264.   #--------------------------------------------------------------------------
  265.   def status_redraw_target(target)
  266.     return unless target.actor?
  267.     @status_window.draw_item($game_party.battle_members.index(target))
  268.   end
  269.   
  270.   #--------------------------------------------------------------------------
  271.   # alias method: execute_action
  272.   #--------------------------------------------------------------------------
  273.   alias scene_battle_execute_action_instant execute_action
  274.   def execute_action
  275.     scene_battle_execute_action_instant
  276.     enemy_add_actions
  277.   end
  278.   
  279.   #--------------------------------------------------------------------------
  280.   # new method: enemy_add_actions
  281.   #--------------------------------------------------------------------------
  282.   def enemy_add_actions
  283.     return if @subject.actor?
  284.     return if @subject.current_action.nil?
  285.     return if @subject.current_action.item.nil?
  286.     return unless @subject.current_action.item.instant
  287.     @subject.add_extra_action
  288.   end
  289.   
  290. end # Scene_Battle

  291. #==============================================================================
  292. #
  293. # ▼  End of File
  294. #
  295. #==============================================================================
复制代码

VA默认的药理知识只对使用效果里的3种恢复效果有效,且只是物品使用者的效果变化,虽然能用来做医生等职业,但是没法做抗药性,不够完善
如果你想增强这个角色的话,我还有个思路,那就是用我下面这个脚本做几个技能,比如消耗只能对一个人用的生命药水,来造成对全体人员生效
的生命药水喷雾。在技能备注输入 Spec:Shoot|Numb:消耗物品数量|Binx:消耗物品ID
  1. #===============================================================================
  2. #
  3. #  简版子弹射击系统 For RMVA
  4. #   
  5. #   版本:0.1
  6. #   说明:直接在你的射击系统的备注中加入:Spec:Shoot|Numb:AA|Binx:BB
  7. #         其中:AA为要消耗子弹的数量;BB为子弹的物品编号,
  8. #         Shoot、Numb和Binx为标志,如果出现冲突可以在下面修改标志符号(很难用到)
  9. #         没有子弹的提示语也可以在下面修改 喵~
  10. #===============================================================================
  11. class Scene_Battle < Scene_Base
  12.   def on_skill_ok
  13.     #===========================================================================
  14.     # 设置技能备注中的标志以及提示语
  15.     shoot_s  = "Shoot"                       # 设置作为射击技能的标志
  16.     @numb_s  = "Numb"                        # 设置需要子弹数量的标志
  17.     @binx_s  = "Binx"                        # 设置作为子弹的物品编号
  18.     #@nohb_s  = "子弹数量已不足,无法射击!"    # 设置子弹不足时的提示语
  19.     #===========================================================================
  20.     @skill = @skill_window.item
  21.     if !$data_skills[@skill.id].note.empty?
  22.       if $data_skills[@skill.id].note.downcase.include?shoot_s.downcase
  23.         notes = $data_skills[@skill.id].note
  24.        if !shoot_skill(notes)
  25.          @skill = nil
  26.          @skill_window.activate
  27.          return 0
  28.        end
  29.       BattleManager.actor.input.set_skill(@skill.id)
  30.       BattleManager.actor.last_skill.object = @skill
  31.      end
  32.    end
  33.     BattleManager.actor.input.set_skill(@skill.id)
  34.     BattleManager.actor.last_skill.object = @skill
  35.     if [email protected]_selection?
  36.        @skill_window.hide
  37.        next_command
  38.     elsif @skill.for_opponent?
  39.        select_enemy_selection
  40.     else
  41.        select_actor_selection
  42.     end
  43.   end
  44.   
  45.   def shoot_skill(note)
  46.     note_s  = $data_skills[@skill.id].note.to_s
  47.     note_s  = note_s[0,note_s.length].to_s
  48.     note_s1 = note_s
  49.     nindex = note_s.downcase.index(@numb_s.downcase)
  50.     note_s[0,nindex] = ""
  51.     note_s = (note_s.split("|"))[0] if note_s.include?"|"
  52.     num = note_s.split(":")[1]
  53.     nindex = note_s1.downcase.index(@binx_s.downcase)
  54.     note_s1[0,nindex] = ""
  55.     note_s1 = (note_s1.split("|"))[1] if note_s1.include?"|"
  56.     itnum = note_s1.split(":")[1].to_i
  57.     if $game_party.item_number($data_items[itnum]).to_i >= num.to_i
  58.        $game_party.lose_item($data_items[itnum],num.to_i)
  59.      else
  60.       @log_window.add_text @nohb_s if @log_window.last_text != @nohb_s
  61.       Sound.play_buzzer
  62.       return nil
  63.     end
  64.   end
  65. end
复制代码

点评

只是单纯希望能多次进行使用物品的行动,第一个脚本比较符合,但是道具很多的场合这战五渣就强成了幻神……  发表于 2019-9-20 22:36

评分

参与人数 1星屑 +100 收起 理由
VIPArcher + 100 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 12:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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