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

Project1

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

[已经解决] 正在做一个游戏,一些技能的问题想请教

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
134 小时
注册时间
2011-11-6
帖子
61
跳转到指定楼层
1
发表于 2011-11-27 08:29:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如何实现这样的技能:
1.使用攻击技能,该回合的回避率降低。我有一个被动技能脚本。可是那是被动技能,永久生效。
2.横版脚本问题。为什么我选择连续攻击,却没有连续攻击的效果,攻击依旧是一次。更不用说3体,4体了
3。如何设置暴击的概率比如增加10%,增加20%。也是不用被动技能的情况

点评

一帖多问,下次注意哦  发表于 2011-11-27 11:05

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1071 小时
注册时间
2011-5-12
帖子
2317

贵宾

2
发表于 2011-11-27 11:20:12 | 只看该作者
本帖最后由 月夜神音 于 2011-11-27 11:21 编辑

1.使用技能后,调用公共事件,使用角色添加状态,状态备注处写:EVA-[10]
  1. #==============================================================================
  2. # ** EVA/HIT/CRI States
  3. #------------------------------------------------------------------------------
  4. # Author  : puppeto4 ([email protected])
  5. # Version : 2.0 revision 3
  6. # Date    : 25 / 06 / 2008
  7. # Note    : Ougi Lied,Rolo Died;_;
  8. # Email me for request and support  :)
  9. #------------------------------------------------------------------------------
  10. # Function : Enable you to create state that increase/decrease
  11. #            character's evasion rate/hit rate/critical rate.
  12. #    EVA+[#] = The state that contains this note will increase evasion by #% when inflicted
  13. #    EVA-[#] = The state that contains this note will decrease evasion by #% when inflicted
  14. #    HIT+[#] = The state that contains this note will increase hit rate by #% when inflicted
  15. #    HIT-[#] = The state that contains this note will decrease hit rate by #% when inflicted
  16. #    CRI+[#] = The state that contains this note will increase critical by #% when inflicted
  17. #    CRI-[#] = The state that contains this note will decrease critical by #% when inflicted
  18. # Change Log :
  19. #  version 1.5(28/06/2008)
  20. #   - Added decrese evasion feature.
  21. #  version 2.0(18/08/2008)
  22. #   - Added increase/decrease hit & cri feature.
  23. #==============================================================================
  24. # ** Game_Actor
  25. #------------------------------------------------------------------------------
  26. #  This class handles actors. It's used within the Game_Actors class
  27. # ($game_actors) and referenced by the Game_Party class ($game_party).
  28. #==============================================================================

  29. class Game_Actor < Game_Battler
  30.   #--------------------------------------------------------------------------
  31.   # * Constants
  32.   #--------------------------------------------------------------------------
  33.   EVADE_TEXT  = "EVA+"
  34.   DEVADE_TEXT = "EVA-"
  35.   HIT_TEXT    = "HIT+"
  36.   DEHIT_TEXT  = "HIT-"
  37.   CRI_TEXT    = "CRI+"
  38.   DECRI_TEXT  = "CRI-"
  39.   #--------------------------------------------------------------------------
  40.   # * Determine if hit bonus is included
  41.   #--------------------------------------------------------------------------
  42.   def extra_hit?
  43.     states.each do |state|
  44.       return true if state.note.include?(HIT_TEXT)
  45.     end
  46.     return false
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # * Determine if hit bonus is included
  50.   #--------------------------------------------------------------------------
  51.   def reduce_hit?
  52.     states.each do |state|
  53.       return true if state.note.include?(DEHIT_TEXT)
  54.     end
  55.     return false
  56.   end  
  57.   #--------------------------------------------------------------------------
  58.   # * Get Hit Rate
  59.   #--------------------------------------------------------------------------
  60.   alias puppet_extra_hit hit
  61.   def hit
  62.     if extra_hit?
  63.       hit_bonus
  64.     elsif reduce_hit?
  65.       lower_hit
  66.     else
  67.       return puppet_extra_hit
  68.     end
  69.   end  
  70.   #--------------------------------------------------------------------------
  71.   # * Give Hit Bonus
  72.   #--------------------------------------------------------------------------
  73.   def hit_bonus
  74.     states.each do |state|
  75.       if state.note[/#{Regexp.quote HIT_TEXT}\[(\d+)\]/].to_a[0]
  76.         if two_swords_style
  77.           n1 = weapons[0] == nil ? 95 : weapons[0].hit
  78.           n2 = weapons[1] == nil ? 95 : weapons[1].hit
  79.           n = [n1, n2].min + $1.to_i
  80.         else
  81.           n = weapons[0] == nil ? 95 + $1.to_i : weapons[0].hit + $1.to_i
  82.         end
  83.         return n
  84.       end
  85.     end      
  86.   end  
  87.   #--------------------------------------------------------------------------
  88.   # * Reduce hit rate
  89.   #--------------------------------------------------------------------------
  90.   def lower_hit
  91.     states.each do |state|
  92.       if state.note[/#{Regexp.quote DEHIT_TEXT}\[(\d+)\]/].to_a[0]
  93.         if two_swords_style
  94.           n1 = weapons[0] == nil ? 95 : weapons[0].hit
  95.           n2 = weapons[1] == nil ? 95 : weapons[1].hit
  96.           n = [n1, n2].min - $1.to_i
  97.         else
  98.           n = weapons[0] == nil ? 95 - $1.to_i : weapons[0].hit - $1.to_i
  99.         end
  100.         return n
  101.       end
  102.     end
  103.   end   
  104.   #--------------------------------------------------------------------------
  105.   # * Determine if evade bonus is included
  106.   #--------------------------------------------------------------------------
  107.   def extra_evade?
  108.     states.each do |state|
  109.       return true if state.note.include?(EVADE_TEXT)
  110.     end
  111.     return false
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # * Determine if evade bonus is included
  115.   #--------------------------------------------------------------------------
  116.   def reduce_evade?
  117.     states.each do |state|
  118.       return true if state.note.include?(DEVADE_TEXT)
  119.     end
  120.     return false
  121.   end  
  122.   #--------------------------------------------------------------------------
  123.   # * Get Evasion Rate
  124.   #--------------------------------------------------------------------------
  125.   alias puppet_extra_eva eva
  126.   def eva
  127.     if extra_evade?
  128.       evade_bonus
  129.     elsif reduce_evade?
  130.       lower_evade
  131.     else
  132.       return puppet_extra_eva
  133.     end  
  134.   end  
  135.   #--------------------------------------------------------------------------
  136.   # * Give Evasion Bonus
  137.   #--------------------------------------------------------------------------
  138.   def evade_bonus
  139.     states.each do |state|
  140.       if state.note[/#{Regexp.quote EVADE_TEXT}\[(\d+)\]/].to_a[0]
  141.         n = 5 + $1.to_i
  142.         for item in armors.compact do n += item.eva end
  143.         return n
  144.       end
  145.     end      
  146.   end  
  147.   #--------------------------------------------------------------------------
  148.   # * Reduce evasion rate
  149.   #--------------------------------------------------------------------------
  150.   def lower_evade
  151.     states.each do |state|
  152.       if state.note[/#{Regexp.quote DEVADE_TEXT}\[(\d+)\]/].to_a[0]
  153.         n = 5 - $1.to_i
  154.         for item in armors.compact do n += item.eva end
  155.         return n
  156.       end
  157.     end
  158.   end  
  159.   #--------------------------------------------------------------------------
  160.   # * Determine if cri bonus is included
  161.   #--------------------------------------------------------------------------
  162.   def extra_cri?
  163.     states.each do |state|
  164.       return true if state.note.include?(CRI_TEXT)
  165.     end
  166.     return false
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # * Determine if cri bonus is included
  170.   #--------------------------------------------------------------------------
  171.   def reduce_cri?
  172.     states.each do |state|
  173.       return true if state.note.include?(DECRI_TEXT)
  174.     end
  175.     return false
  176.   end  
  177.   #--------------------------------------------------------------------------
  178.   # * Get Cri Rate
  179.   #--------------------------------------------------------------------------
  180.   alias puppet_extra_cri cri
  181.   def cri
  182.     if extra_cri?
  183.       cri_bonus
  184.     elsif reduce_cri?
  185.       lower_cri
  186.     else
  187.       return puppet_extra_cri
  188.     end
  189.   end  
  190.   #--------------------------------------------------------------------------
  191.   # * Give Cri Bonus
  192.   #--------------------------------------------------------------------------
  193.   def cri_bonus
  194.     states.each do |state|
  195.       if state.note[/#{Regexp.quote CRI_TEXT}\[(\d+)\]/].to_a[0]
  196.         n = 4
  197.         n += $1.to_i
  198.         n += 4 if actor.critical_bonus
  199.         for weapon in weapons.compact
  200.           n += 4 if weapon.critical_bonus
  201.         end
  202.         return n
  203.       end
  204.     end      
  205.   end  
  206.   #--------------------------------------------------------------------------
  207.   # * Reduce cri rate
  208.   #--------------------------------------------------------------------------
  209.   def lower_cri
  210.     states.each do |state|
  211.       if state.note[/#{Regexp.quote DECRI_TEXT}\[(\d+)\]/].to_a[0]
  212.     n = 4
  213.     n += 4 if actor.critical_bonus
  214.     for weapon in weapons.compact
  215.       n += 4 if weapon.critical_bonus
  216.     end
  217.     n -= $1.to_i
  218.     return n
  219.       end
  220.     end
  221.   end      
  222. end
  223. #==============================================================================
  224. # ** End of EVA/HIT/CRI States : Script
  225. #==============================================================================
复制代码
2.全局搜索class Skill,修改def base_action下面即可
3.与第1一样,添加状态,备注写:CRI+[10]
找我请找芙蕾娅
顺带一提,完全看得懂我头像请捡起你自己的节操哟(自重
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
134 小时
注册时间
2011-11-6
帖子
61
3
 楼主| 发表于 2011-11-27 11:33:50 | 只看该作者
我刚才也想到了一个方法,和你这个差不多。设定一个暴击状态,这个状态持有的时候,习得被动技能暴击。我有个被动技能永久加暴击的脚本。状态消失,暴击效果消失。

不过还是很感谢,你这个方法简单多了
回复

使用道具 举报

Lv1.梦旅人

水土火风重逢处

梦石
0
星屑
239
在线时间
691 小时
注册时间
2010-7-17
帖子
3042
4
发表于 2011-11-27 11:36:10 | 只看该作者
记得67前辈做过一个VX的状态增强的脚本.....
独坐望城,望断天涯
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-1-2 02:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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