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

Project1

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

[有事请教] 如何制作让普通攻击附带技能效果或者能触发公用事件

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
4 小时
注册时间
2019-4-5
帖子
4
跳转到指定楼层
1
发表于 2019-4-23 23:34:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
想制作一个类似dota里的法球一样的效果

Lv2.观梦者

梦石
0
星屑
353
在线时间
15 小时
注册时间
2019-4-14
帖子
31
2
发表于 2019-4-23 23:54:01 | 只看该作者
问题十分含糊。。。
你是要装备特定武器后发动技能还是每个角色都要发动技能???
还有发动技能是必发还是概率???
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
4 小时
注册时间
2019-4-5
帖子
4
3
 楼主| 发表于 2019-4-24 00:01:08 | 只看该作者
活气寒露 发表于 2019-4-23 23:54
问题十分含糊。。。
你是要装备特定武器后发动技能还是每个角色都要发动技能???
还有发动技能是必发还是 ...

就是装备特定武器时候发动,法球效果是必定触发的。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
353
在线时间
15 小时
注册时间
2019-4-14
帖子
31
4
发表于 2019-4-24 22:56:14 | 只看该作者
  1. module Weapon_Attack_Skill
  2.   Weapon_id = [3]
  3.   Skill_id = [61]
  4. end
  5. class Scene_Battle < Scene_Base
  6.   include Weapon_Attack_Skill
  7.   #--------------------------------------------------------------------------
  8.   # * 作戰行為處理
  9.   #--------------------------------------------------------------------------
  10.   def process_action
  11.     return if judge_win_loss
  12.     return if $game_temp.next_scene != nil
  13.     set_next_active_battler
  14.     if @active_battler == nil
  15.       turn_end
  16.       return
  17.     end
  18.     @message_window.clear
  19.     wait(5)
  20.     @active_battler.white_flash = true
  21.     unless @active_battler.action.forcing
  22.       @active_battler.action.prepare
  23.     end
  24.     if @active_battler.action.valid?
  25.       execute_action
  26.     end
  27.     for i in 0...Weapon_id.size
  28.     if @active_battler.is_a?(Game_Actor)
  29.     if @active_battler.weapon_id == Weapon_id[i]
  30.     execute_action_skill  
  31.     end
  32.   end
  33. end
  34.     unless @active_battler.action.forcing
  35.       @message_window.clear
  36.       remove_states_auto
  37.       display_current_state
  38.     end
  39.     @active_battler.white_flash = false
  40.     @message_window.clear
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # * 更新主角行動指令選擇的指令輸入資訊
  44.   #--------------------------------------------------------------------------
  45.   def update_actor_command_selection
  46.     if Input.trigger?(Input::B)
  47.       Sound.play_cancel
  48.       prior_actor
  49.     elsif Input.trigger?(Input::C)
  50.       case @actor_command_window.index
  51.       when 0  # 攻擊
  52.         Sound.play_decision
  53.         for i in 0...Weapon_id.size
  54.         if @active_battler.weapon_id == Weapon_id[i]
  55.         @skill = $data_skills[Skill_id[i]]
  56.         @active_battler.action.set_skill(@skill.id)
  57.         if @skill.need_selection?
  58.         if @skill.for_opponent?
  59.         start_target_enemy_selection
  60.         else
  61.         start_target_actor_selection
  62.       end
  63.       else
  64.         next_actor
  65.       end
  66.       else
  67.           @active_battler.action.set_attack
  68.           start_target_enemy_selection
  69.        end
  70.      end
  71.       when 1  # 技能
  72.         Sound.play_decision
  73.         start_skill_selection
  74.       when 2  # 防禦
  75.         Sound.play_decision
  76.         @active_battler.action.set_guard
  77.         next_actor
  78.       when 3  # 用品
  79.         Sound.play_decision
  80.         start_item_selection
  81.       end
  82.     end
  83.   end
  84. end
复制代码

简单写了一个,默认装备3号武器后,普通攻击发动61号技能
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
4 小时
注册时间
2019-4-5
帖子
4
5
 楼主| 发表于 2019-4-25 01:39:05 | 只看该作者
活气寒露 发表于 2019-4-24 22:56
简单写了一个,默认装备3号武器后,普通攻击发动61号技能

首先非常感谢,这个脚本能用。
不过自己测试的时候遇到了一个问题,实际平A会触发两次的技能效果,不知道是为什么,我是RMVX新手,对脚本不是很懂,望赐教
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
353
在线时间
15 小时
注册时间
2019-4-14
帖子
31
6
发表于 2019-4-25 22:52:23 | 只看该作者
  1. module Weapon_Attack_Skill
  2.   Weapon_id = [3]
  3.   Skill_id = [61]
  4. end
  5. class Scene_Battle < Scene_Base
  6.   include Weapon_Attack_Skill
  7.   #--------------------------------------------------------------------------
  8.   # * 作戰行為處理
  9.   #--------------------------------------------------------------------------
  10.   def process_action
  11.     return if judge_win_loss
  12.     return if $game_temp.next_scene != nil
  13.     set_next_active_battler
  14.     if @active_battler == nil
  15.       turn_end
  16.       return
  17.     end
  18.     @message_window.clear
  19.     wait(5)
  20.     @active_battler.white_flash = true
  21.     unless @active_battler.action.forcing
  22.       @active_battler.action.prepare
  23.     end
  24.     if @active_battler.action.valid?
  25.       execute_action
  26.       @active_battler.action.basic = 3
  27.     end
  28.     if @active_battler.is_a?(Game_Actor)
  29.     for i in 0...Weapon_id.size
  30.     if @active_battler.weapon_id == Weapon_id[i]
  31.     execute_action_skill if @active_battler.action.basic == -1
  32.     end
  33.   end
  34. end
  35.     unless @active_battler.action.forcing
  36.       @message_window.clear
  37.       remove_states_auto
  38.       display_current_state
  39.     end
  40.     @active_battler.white_flash = false
  41.     @message_window.clear
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # * 更新主角行動指令選擇的指令輸入資訊
  45.   #--------------------------------------------------------------------------
  46.   def update_actor_command_selection
  47.     if Input.trigger?(Input::B)
  48.       Sound.play_cancel
  49.       prior_actor
  50.     elsif Input.trigger?(Input::C)
  51.       case @actor_command_window.index
  52.       when 0  # 攻擊
  53.         Sound.play_decision
  54.         for i in 0...Weapon_id.size
  55.         if @active_battler.weapon_id == Weapon_id[i]
  56.         @skill = $data_skills[Skill_id[i]]
  57.         @active_battler.action.set_skill(@skill.id)
  58.         if @skill.need_selection?
  59.         if @skill.for_opponent?
  60.         start_target_enemy_selection
  61.         else
  62.         start_target_actor_selection
  63.       end
  64.       else
  65.         next_actor
  66.       end
  67.       else
  68.           @active_battler.action.set_attack
  69.           start_target_enemy_selection
  70.        end
  71.      end
  72.       when 1  # 技能
  73.         Sound.play_decision
  74.         start_skill_selection
  75.       when 2  # 防禦
  76.         Sound.play_decision
  77.         @active_battler.action.set_guard
  78.         next_actor
  79.       when 3  # 用品
  80.         Sound.play_decision
  81.         start_item_selection
  82.       end
  83.     end
  84.   end
  85. end
复制代码

没时间完善,勉强能用
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 19:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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