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

Project1

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

[已经解决] 如何在战斗中更改武器

[复制链接]

Lv1.梦旅人

梦石
0
星屑
49
在线时间
116 小时
注册时间
2011-10-16
帖子
13
跳转到指定楼层
1
发表于 2012-4-20 13:30:27 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本人想在游戏里设置一个技能,可以在战斗中更换武器,可在测试事总是说对使用者无效,请教一下到底应该怎样解决

点评

这个是自动的....即任何角色在战斗菜单中都有一个更换装备的选项,懂了不?  发表于 2012-4-21 14:38
╮(╯▽╰)╭

Lv4.逐梦者 (超级版主)

嗜谎者

梦石
2
星屑
16526
在线时间
3892 小时
注册时间
2010-9-12
帖子
9632

极短24评委极短23评委极短22评委极短21评委开拓者

2
发表于 2012-4-20 15:17:41 | 只看该作者

如图,不要忘记技能有使用效果范围的限定,更改装备的话设置成针对自己释放的技能就好了。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
116 小时
注册时间
2011-10-16
帖子
13
3
 楼主| 发表于 2012-4-20 17:14:30 | 只看该作者
Luciffer 发表于 2012-4-20 15:17
如图,不要忘记技能有使用效果范围的限定,更改装备的话设置成针对自己释放的技能就好了。 ...

我是像这样设置的,就是在战斗的时候使用这个技能对使用者无效
╮(╯▽╰)╭
回复

使用道具 举报

Lv1.梦旅人

哆啦菌

梦石
0
星屑
46
在线时间
795 小时
注册时间
2010-7-24
帖子
3800
4
发表于 2012-4-20 18:09:04 | 只看该作者
事件的话,弄了半天不懂,不过脚本倒是有(转自地球村的那个脚本合集)
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Command Equip v1.01
  4. # -- Last Updated: 2012.01.10
  5. # -- Level: Easy, Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.10 - Compatibility Update: Ace Battle Engine v1.15+
  15. # 2011.12.13 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # This command allows your actors to be able to change equipment in the middle
  21. # of battle by directly accessing the equip scene in the middle of battle, and
  22. # returning back to the battle scene exactly as it was. Furthermore, you can
  23. # limit how frequently your player can switch equipment for each of the actors.
  24. #
  25. #==============================================================================
  26. # ▼ Instructions
  27. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28. # To install this script, open up your script editor and copy/paste this script
  29. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  30. #
  31. #==============================================================================
  32. # ▼ Compatibility
  33. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  35. # it will run with RPG Maker VX without adjusting.
  36. #
  37. #==============================================================================

  38. module YEA
  39.   module COMMAND_EQUIP
  40.    
  41.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  42.     # - Battle Equip Settings -
  43.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  44.     # This is just how the text appears visually in battle for your actors and
  45.     # how often they can change equips in battle.
  46.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  47.     COMMAND_TEXT   = "装备"      # Text used for the command.
  48.     EQUIP_COOLDOWN = 2            # Turns to wait before re-equipping.
  49.    
  50.   end # COMMAND_EQUIP
  51. end # YEA

  52. #==============================================================================
  53. # ▼ Editting anything past this point may potentially result in causing
  54. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  55. # halitosis so edit at your own risk.
  56. #==============================================================================

  57. #==============================================================================
  58. # ■ SceneManager
  59. #==============================================================================

  60. module SceneManager
  61.   
  62.   #--------------------------------------------------------------------------
  63.   # new method: self.force_recall
  64.   #--------------------------------------------------------------------------
  65.   def self.force_recall(scene_class)
  66.     @scene = scene_class
  67.   end
  68.   
  69. end # SceneManager

  70. #==============================================================================
  71. # ■ Game_Battler
  72. #==============================================================================

  73. class Game_Battler < Game_BattlerBase
  74.   
  75.   #--------------------------------------------------------------------------
  76.   # alias method: on_battle_start
  77.   #--------------------------------------------------------------------------
  78.   alias game_battler_on_battle_start_ceq on_battle_start
  79.   def on_battle_start
  80.     game_battler_on_battle_start_ceq
  81.     reset_equip_cooldown
  82.   end
  83.   
  84.   #--------------------------------------------------------------------------
  85.   # new method: reset_equip_cooldown
  86.   #--------------------------------------------------------------------------
  87.   def reset_equip_cooldown
  88.     @equip_cooldown = 0
  89.   end
  90.   
  91.   #--------------------------------------------------------------------------
  92.   # alias method: on_turn_end
  93.   #--------------------------------------------------------------------------
  94.   alias game_battler_on_turn_end_ceq on_turn_end
  95.   def on_turn_end
  96.     game_battler_on_turn_end_ceq
  97.     update_equip_cooldown
  98.   end
  99.   
  100.   #--------------------------------------------------------------------------
  101.   # new method: update_equip_cooldown
  102.   #--------------------------------------------------------------------------
  103.   def update_equip_cooldown
  104.     reset_equip_cooldown if @equip_cooldown.nil?
  105.     @equip_cooldown = [@equip_cooldown - 1, 0].max
  106.   end
  107.   
  108.   #--------------------------------------------------------------------------
  109.   # new method: battle_equippable?
  110.   #--------------------------------------------------------------------------
  111.   def battle_equippable?
  112.     reset_equip_cooldown if @equip_cooldown.nil?
  113.     return @equip_cooldown <= 0
  114.   end
  115.   
  116.   #--------------------------------------------------------------------------
  117.   # new method: set_equip_cooldown
  118.   #--------------------------------------------------------------------------
  119.   def set_equip_cooldown
  120.     @equip_cooldown = YEA::COMMAND_EQUIP::EQUIP_COOLDOWN
  121.   end
  122.   
  123.   #--------------------------------------------------------------------------
  124.   # alias method: on_battle_end
  125.   #--------------------------------------------------------------------------
  126.   alias game_battler_on_battle_end_ceq on_battle_end
  127.   def on_battle_end
  128.     game_battler_on_battle_end_ceq
  129.     reset_equip_cooldown
  130.   end
  131.   
  132. end # Game_Battler

  133. #==============================================================================
  134. # ■ Window_EquipCommand
  135. #==============================================================================

  136. class Window_EquipCommand < Window_HorzCommand
  137.   
  138.   #--------------------------------------------------------------------------
  139.   # overwrite method: handle?
  140.   #--------------------------------------------------------------------------
  141.   def handle?(symbol)
  142.     if [:pageup, :pagedown].include?(symbol) && $game_party.in_battle
  143.       return false
  144.     end
  145.     return super(symbol)
  146.   end
  147.   
  148. end # Window_EquipCommand

  149. #==============================================================================
  150. # ■ Window_ActorCommand
  151. #==============================================================================

  152. class Window_ActorCommand < Window_Command
  153.   
  154.   #--------------------------------------------------------------------------
  155.   # alias method: make_command_list
  156.   #--------------------------------------------------------------------------
  157.   alias window_actorcommand_make_command_list_ceq make_command_list
  158.   def make_command_list
  159.     window_actorcommand_make_command_list_ceq
  160.     return unless @actor
  161.     return if $imported["YEA-BattleCommandList"]
  162.     add_equip_command
  163.   end
  164.   
  165.   #--------------------------------------------------------------------------
  166.   # new method: add_equip_command
  167.   #--------------------------------------------------------------------------
  168.   def add_equip_command
  169.     text = YEA::COMMAND_EQUIP::COMMAND_TEXT
  170.     add_command(text, :equip, @actor.battle_equippable?)
  171.   end
  172.   
  173. end # Window_ActorCommand

  174. #==============================================================================
  175. # ■ Scene_Battle
  176. #==============================================================================

  177. class Scene_Battle < Scene_Base
  178.   
  179.   #--------------------------------------------------------------------------
  180.   # alias method: create_actor_command_window
  181.   #--------------------------------------------------------------------------
  182.   alias create_actor_command_window_ceq create_actor_command_window
  183.   def create_actor_command_window
  184.     create_actor_command_window_ceq
  185.     @actor_command_window.set_handler(:equip, method(:command_equip))
  186.   end
  187.   
  188.   #--------------------------------------------------------------------------
  189.   # new method: command_equip
  190.   #--------------------------------------------------------------------------
  191.   def command_equip
  192.     Graphics.freeze
  193.     @info_viewport.visible = false
  194.     hide_extra_gauges if $imported["YEA-BattleEngine"]
  195.     SceneManager.snapshot_for_background
  196.     actor = $game_party.battle_members[@status_window.index]
  197.     $game_party.menu_actor = actor
  198.     previous_equips = actor.equips.clone
  199.     index = @actor_command_window.index
  200.     oy = @actor_command_window.oy
  201.     #---
  202.     SceneManager.call(Scene_Equip)
  203.     SceneManager.scene.main
  204.     SceneManager.force_recall(self)
  205.     #---
  206.     show_extra_gauges if $imported["YEA-BattleEngine"]
  207.     actor.set_equip_cooldown if previous_equips != actor.equips
  208.     @info_viewport.visible = true
  209.     @status_window.refresh
  210.     @actor_command_window.setup(actor)
  211.     @actor_command_window.select(index)
  212.     @actor_command_window.oy = oy
  213.     perform_transition
  214.     $game_system.battle_bgm.play
  215.   end
  216.   
  217. end # Scene_Battle

  218. #==============================================================================
  219. #
  220. # ▼ End of File
  221. #
  222. #==============================================================================
复制代码

点评

这个...脚本怎么用?  发表于 2012-4-20 22:37
随便看看
回复

使用道具 举报

Lv4.逐梦者 (超级版主)

嗜谎者

梦石
2
星屑
16526
在线时间
3892 小时
注册时间
2010-9-12
帖子
9632

极短24评委极短23评委极短22评委极短21评委开拓者

5
发表于 2012-4-20 19:57:10 | 只看该作者
事件的话有没有考虑属性,抗性的问题?不如附加一个不显示信息的状态吧,不然似乎技能的确不会生效的样子。。。

点评

这个能讲的具体点吗?  发表于 2012-4-20 23:15
回复

使用道具 举报

Lv3.寻梦者

虚空人形

梦石
0
星屑
4517
在线时间
2037 小时
注册时间
2011-8-11
帖子
3398

贵宾

6
发表于 2012-4-20 22:04:11 | 只看该作者
在技能使用效果那里加公共事件,设置更换装备也勉强可用。
回复

使用道具 举报

Lv4.逐梦者 (超级版主)

嗜谎者

梦石
2
星屑
16526
在线时间
3892 小时
注册时间
2010-9-12
帖子
9632

极短24评委极短23评委极短22评委极短21评委开拓者

7
发表于 2012-4-21 11:22:09 | 只看该作者
数据库——状态——更改最大值——+1
然后新增加的状态信息什么的不要改,空着,显示优先级改低一点,
让你那个技能附加先这个状态,然后再触发公共事件试试。
(应该是这个问题吧。。。)
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 16:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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