查看: 3296|回复: 2

[已经解决] 武器普通攻击

[复制链接]
梦石
0
星屑
55
在线时间
148 小时
注册时间
2013-11-9
回帖
14
发表于 2014-7-27 16:30:08 | 显示全部楼层 |阅读模式

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

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

×
想请教一下,一般战斗时普通攻击是按造角色的物理攻击来做伤害

有没有办法把一种武器类型的普通攻击改成吃魔法攻击系数而不是物理

其余武器类型依旧是按造物理攻击来做伤害

例如武器类型斧头的普通攻击伤害是依造物理攻击系数,魔法长枪的普通攻击伤害改成依造魔法攻击系数这样

…あたしは天

梦石
0
星屑
2311
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2014-7-27 16:37:07 | 显示全部楼层
https://rpg.blue/thread-365973-1-1.html

注意群组的置顶 && 公告哦~ 不然报错别怪我哦~

点评

↓ VIP是说他差点重复回答了= =  发表于 2014-7-27 16:57
不好意思,下次会多注意一点。  发表于 2014-7-27 16:45
差点又追尾~  发表于 2014-7-27 16:38

评分

参与人数 1星屑 +100 收起 理由
VIPArcher + 100 我很赞同

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
444 小时
注册时间
2011-1-3
回帖
150

开拓者

发表于 2014-7-27 16:43:32 | 显示全部楼层
你需要这个。
在技能库里设置一个新的技能,伤害计算方式自己设定。
然后在武器备注栏填上<attack skill: x>   X指的是技能库里的技能ID。填上你设定的新技能就可以让装备该武器的人物
普通攻击会变为该技能效果。
此脚本和taroxd的被动技能,tomoaky的RGSS3_パッシブスキル脚本冲突。
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Weapon Attack Replace v1.01
  4. # -- Last Updated: 2011.12.19
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2011.12.19 - Added notetags for Actors, and Classes.
  15. # 2011.12.17 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # By default, RPG Maker VX Ace sets all normal attacks to call upon Skill #1
  21. # to do all of the basic attack functions. While this is a great idea, it also
  22. # meant that all weapons would share the same basic attack damage formula and
  23. # effects. With this script, you can set different weapon types to use any
  24. # skill for its basic attack.
  25. #
  26. #==============================================================================
  27. # ▼ Instructions
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # To install this script, open up your script editor and copy/paste this script
  30. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  31. #
  32. # -----------------------------------------------------------------------------
  33. # Actor Notetags - These notetags go in the actors notebox in the database.
  34. # -----------------------------------------------------------------------------
  35. # <attack skill: x>
  36. # This sets the actor's default attack (if no weapon is equipped) to be x. The
  37. # actor's custom attack skill will take priority over a class's custom attack
  38. # skill, which will take priority over the default attack skill (skill #1).
  39. #
  40. # -----------------------------------------------------------------------------
  41. # Class Notetags - These notetags go in the class notebox in the database.
  42. # -----------------------------------------------------------------------------
  43. # <attack skill: x>
  44. # This sets the class's default attack (if no weapon is equipped) to be x. An
  45. # actor's custom attack skill will take priority over the class's custom attack
  46. # skill, which will take priority over the default attack skill (skill #1).
  47. #
  48. # -----------------------------------------------------------------------------
  49. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  50. # -----------------------------------------------------------------------------
  51. # <attack skill: x>
  52. # This sets the worn weapon's attack skill to x. Note that if an actor is dual
  53. # wielding, the attack skill of the first weapon will take priority over the
  54. # second weapon.
  55. #
  56. #==============================================================================
  57. # ▼ Compatibility
  58. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  59. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  60. # it will run with RPG Maker VX without adjusting.
  61. #
  62. # For maximum compatibility with YEA - Ace Battle Engine, place this script
  63. # below Ace Battle Engine in the script listing.
  64. #
  65. #==============================================================================

  66. module YEA
  67.   module WEAPON_ATTACK_REPLACE
  68.    
  69.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  70.     # - Basic Settings -
  71.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  72.     # If for whatever reason, you wish to change the default attack skill to
  73.     # something other than one, change the constant below.
  74.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  75.     DEFAULT_ATTACK_SKILL_ID = 1
  76.    
  77.   end # WEAPON_ATTACK_REPLACE
  78. end # YEA

  79. #==============================================================================
  80. # ▼ Editting anything past this point may potentially result in causing
  81. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  82. # halitosis so edit at your own risk.
  83. #==============================================================================

  84. module YEA
  85.   module REGEXP
  86.   module BASEITEM
  87.    
  88.     ATTACK_SKILL = /<(?:ATTACK_SKILL|attack skill):[ ](\d+)>/i
  89.    
  90.   end # BASEITEM
  91.   module WEAPON
  92.    
  93.     ATTACK_SKILL = /<(?:ATTACK_SKILL|attack skill):[ ](\d+)>/i
  94.    
  95.   end # WEAPON
  96.   end # REGEXP
  97. end # YEA

  98. #==============================================================================
  99. # ■ DataManager
  100. #==============================================================================

  101. module DataManager
  102.   
  103.   #--------------------------------------------------------------------------
  104.   # alias method: load_database
  105.   #--------------------------------------------------------------------------
  106.   class <<self; alias load_database_war load_database; end
  107.   def self.load_database
  108.     load_database_war
  109.     load_notetags_war
  110.   end
  111.   
  112.   #--------------------------------------------------------------------------
  113.   # new method: load_notetags_war
  114.   #--------------------------------------------------------------------------
  115.   def self.load_notetags_war
  116.     groups = [$data_actors, $data_classes, $data_weapons]
  117.     for group in groups
  118.       for obj in group
  119.         next if obj.nil?
  120.         obj.load_notetags_war
  121.       end
  122.     end
  123.   end
  124.   
  125. end # DataManager

  126. #==============================================================================
  127. # ■ RPG::BaseItem
  128. #==============================================================================

  129. class RPG::BaseItem
  130.   
  131.   #--------------------------------------------------------------------------
  132.   # public instance variables
  133.   #--------------------------------------------------------------------------
  134.   attr_accessor :attack_skill
  135.   
  136.   #--------------------------------------------------------------------------
  137.   # common cache: load_notetags_war
  138.   #--------------------------------------------------------------------------
  139.   def load_notetags_war
  140.     @attack_skill = nil
  141.     #---
  142.     self.note.split(/[\r\n]+/).each { |line|
  143.       case line
  144.       #---
  145.       when YEA::REGEXP::BASEITEM::ATTACK_SKILL
  146.         @attack_skill = $1.to_i
  147.       #---
  148.       end
  149.     } # self.note.split
  150.     #---
  151.     return if self.is_a?(RPG::Actor)
  152.     return unless @attack_skill.nil?
  153.     @attack_skill = YEA::WEAPON_ATTACK_REPLACE::DEFAULT_ATTACK_SKILL_ID
  154.   end
  155.   
  156. end # RPG::BaseItem

  157. #==============================================================================
  158. # ■ RPG::Weapon
  159. #==============================================================================

  160. class RPG::Weapon < RPG::EquipItem
  161.   
  162.   #--------------------------------------------------------------------------
  163.   # public instance variables
  164.   #--------------------------------------------------------------------------
  165.   attr_accessor :attack_skill
  166.   
  167.   #--------------------------------------------------------------------------
  168.   # common cache: load_notetags_war
  169.   #--------------------------------------------------------------------------
  170.   def load_notetags_war
  171.     @attack_skill = YEA::WEAPON_ATTACK_REPLACE::DEFAULT_ATTACK_SKILL_ID
  172.     #---
  173.     self.note.split(/[\r\n]+/).each { |line|
  174.       case line
  175.       #---
  176.       when YEA::REGEXP::WEAPON::ATTACK_SKILL
  177.         @attack_skill = $1.to_i
  178.       #---
  179.       end
  180.     } # self.note.split
  181.     #---
  182.   end
  183.   
  184. end # RPG::Weapon

  185. #==============================================================================
  186. # ■ Game_BattlerBase
  187. #==============================================================================

  188. class Game_BattlerBase
  189.   
  190.   #--------------------------------------------------------------------------
  191.   # overwrite method: attack_skill_id
  192.   #--------------------------------------------------------------------------
  193.   def attack_skill_id
  194.     return weapon_attack_skill_id if actor?
  195.     return YEA::WEAPON_ATTACK_REPLACE::DEFAULT_ATTACK_SKILL_ID
  196.   end
  197.   
  198. end # Game_BattlerBase

  199. #==============================================================================
  200. # ■ Game_Actor
  201. #==============================================================================

  202. class Game_Actor < Game_Battler
  203.   
  204.   #--------------------------------------------------------------------------
  205.   # new method: weapon_attack_skill_id
  206.   #--------------------------------------------------------------------------
  207.   def weapon_attack_skill_id
  208.     for weapon in weapons
  209.       next if weapon.nil?
  210.       return weapon.attack_skill
  211.     end
  212.     return self.actor.attack_skill unless self.actor.attack_skill.nil?
  213.     return self.class.attack_skill
  214.   end
  215.   
  216. end # Game_Actor

  217. #==============================================================================
  218. # ■ Scene_Battle
  219. #==============================================================================

  220. class Scene_Battle < Scene_Base
  221.   
  222.   #--------------------------------------------------------------------------
  223.   # new method: command_use_skill
  224.   #--------------------------------------------------------------------------
  225.   def command_attack
  226.     [url=home.php?mod=space&uid=260100]@skill[/url] = $data_skills[BattleManager.actor.attack_skill_id]
  227.     BattleManager.actor.input.set_skill(@skill.id)
  228.     if $imported["YEA-BattleEngine"]
  229.       status_redraw_target(BattleManager.actor)
  230.       $game_temp.battle_aid = @skill
  231.       if @skill.for_opponent?
  232.         select_enemy_selection
  233.       elsif @skill.for_friend?
  234.         select_actor_selection
  235.       else
  236.         next_command
  237.         $game_temp.battle_aid = nil
  238.       end
  239.     else
  240.       if !@skill.need_selection?
  241.         next_command
  242.       elsif @skill.for_opponent?
  243.         select_enemy_selection
  244.       else
  245.         select_actor_selection
  246.       end
  247.     end
  248.   end
  249.   
  250.   #--------------------------------------------------------------------------
  251.   # alias method: on_actor_cancel
  252.   #--------------------------------------------------------------------------
  253.   alias scene_battle_on_actor_cancel_war on_actor_cancel
  254.   def on_actor_cancel
  255.     scene_battle_on_actor_cancel_war
  256.     case @actor_command_window.current_symbol
  257.     when :attack
  258.       @help_window.hide
  259.       @status_window.show
  260.       @actor_command_window.activate
  261.       status_redraw_target(BattleManager.actor)
  262.     end
  263.   end
  264.   
  265.   #--------------------------------------------------------------------------
  266.   # alias method: on_enemy_cancel
  267.   #--------------------------------------------------------------------------
  268.   alias scene_battle_on_enemy_cancel_war on_enemy_cancel
  269.   def on_enemy_cancel
  270.     scene_battle_on_enemy_cancel_war
  271.     case @actor_command_window.current_symbol
  272.     when :attack
  273.       @help_window.hide
  274.       @status_window.show
  275.       @actor_command_window.activate
  276.       status_redraw_target(BattleManager.actor)
  277.     end
  278.   end
  279.   
  280.   #--------------------------------------------------------------------------
  281.   # new method: status_redraw_target
  282.   #--------------------------------------------------------------------------
  283.   def status_redraw_target(target)
  284.     return unless target.actor?
  285.     @status_window.draw_item($game_party.battle_members.index(target))
  286.   end
  287.   
  288. end # Scene_Battle

  289. #==============================================================================
  290. #
  291. # ▼ End of File
  292. #
  293. #==============================================================================
复制代码

点评

我没看到哪儿撞了……算了  发表于 2014-7-27 17:16
@taroxd 有的,使用该脚本后在使用或者tomoaky写的被动技能脚本。会导致Yanfly的脚本失效。  发表于 2014-7-27 17:10
我没看出冲突的说……  发表于 2014-7-27 16:51
神速!感谢大触帮忙。  发表于 2014-7-27 16:46

评分

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

查看全部评分

回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部