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

Project1

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

[有事请教] 【求助】如何制作锁血限伤

[复制链接]

Lv1.梦旅人

梦石
0
星屑
107
在线时间
80 小时
注册时间
2024-1-8
帖子
24
跳转到指定楼层
1
发表于 2025-7-7 20:05:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
20星屑
先上脚本

RUBY 代码复制
  1. #==============================================================================
  2. # ★ RGSS3_メタルボディ Ver1.0
  3. #==============================================================================
  4. =begin
  5.  
  6. 作者:tomoaky
  7. webサイト:ひきも記は閉鎖しました。 (http://hikimoki.sakura.ne.jp/)
  8.  
  9. 2013.06.06  Ver1.0
  10.   公開
  11.  
  12.  
  13.  
  14. 在buff中备注↓
  15. <最大受伤 5>受到的单段伤害不高于5
  16. <最大受伤 self.mhp/10>单段伤害不高于角色hp的10%
  17.  
  18. =end
  19.  
  20. #==============================================================================
  21. # ■ Game_Battler
  22. #==============================================================================
  23. class Game_Battler < Game_BattlerBase
  24.  
  25.   def metal_body
  26.     feature_objects.each do |object|
  27.     if /<最大受伤\s*(.+)\s*>/ =~ object.note
  28.       formula = $1
  29.       return eval(formula).to_i
  30.       end
  31.     end
  32.     nil
  33.   end
  34.  
  35.  
  36.  
  37.  
  38.   #--------------------------------------------------------------------------
  39.   # ● 防御修正の適用
  40.   #--------------------------------------------------------------------------
  41.   alias tmmetalbody_game_battler_apply_guard apply_guard
  42.   def apply_guard(damage)
  43.     result = tmmetalbody_game_battler_apply_guard(damage)
  44.     return (result > 0 && metal_body ? [result, metal_body].min : result)
  45.   end
  46. end



目前的情况为,该脚本的效果为,持有buff下,该角色(敌人)单次受到的伤害不会高于一定的数值。

假设为1000,那么攻击无穷大的情况下一个3段的攻击可以打BOSS扣1000*3=3000

如果有4*9=36段攻击,那么该BOSS就会被打36000血

因为这个脚本是锁单段不是技能…………现在我希望实现的效果为。

在持有xx状态下,我方单个技能(无论为1段还是999段伤害的),都只能打BOSS血量上限的一定比值。

辛苦大佬们看一下能不能通过改本脚本或者打补丁的方式实现这个效果
(因为游戏技能非常非常多有4位数以上,所以我只能通过脚本实现效果了)



最佳答案

查看完整内容

我看一下~~~~~~~~~~~~~~~~ #-------------------------------------------------------------------------- # ● 防御修正の適用 #-------------------------------------------------------------------------- alias tmmetalbody_game_battler_apply_guard apply_guard def apply_guard(damage) @topdamage||=0 result = tmmetalbody_game_battler_apply_guard(damage) @topdamage+=(result > 0 && metal_bo ...

Lv5.捕梦者

梦石
0
星屑
37528
在线时间
10899 小时
注册时间
2009-3-15
帖子
4875
2
发表于 2025-7-7 20:05:16 | 只看该作者
本帖最后由 soulsaga 于 2025-7-7 21:33 编辑

我看一下~~~~~~~~~~~~~~~~
#--------------------------------------------------------------------------
  # ● 防御修正の適用
  #--------------------------------------------------------------------------
  alias tmmetalbody_game_battler_apply_guard apply_guard
  def apply_guard(damage)
    @topdamage||=0
    result = tmmetalbody_game_battler_apply_guard(damage)
    @topdamage+=(result > 0 && metal_body ? [result, metal_body].min : result) if @topdamage<metal_body
    if @topdamage>=metal_body
    d=@topdamage-metal_body
    @topdamage=metal_body
    return d
    end
    return (result > 0 && metal_body ? [result, metal_body].min : result)
  end
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-18 14:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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