Buckshot 的属性
我用一套标准化的数学框架替换了 Minecraft 中的战斗、物理和魔法计算。所有计算都遵循严格的运算顺序,即先应用百分比修正,再应用固定值修正。我引入了 12 个新的动态属性,以支持整合包开发者和玩家进行自定义缩放。
护甲引擎与反护甲
原版 Minecraft 的护甲公式存在根本性缺陷。没人真正知道其底层是如何运作的;当模组引入高数值时,它会完全失效;而且在尝试将其与其他自定义战斗系统集成时,它完全缺乏弹性。
我用标准的递减收益公式替换了原版计算:
伤害减免百分比 = 有效护甲 / (有效护甲 + C)
其中 C 是一个可配置的常数,默认为 20.0。这确保了数值可以无限扩展,而实体永远不会达到完全免疫伤害的状态。
护甲韧性(Armor Toughness)在数学上被重新设计为一个固定的伤害减免变量,而不是任意的缓冲值。新的 Durable(耐久度)属性决定了这一固定减免在方程中的应用时机。Durable 值为 0.5 意味着你的一半韧性会在计算护甲百分比减免之前减少 incoming damage(受到的伤害),而另一半则是在应用百分比减免之后从最终伤害中扣除。逻辑结构如下:
初始固定减免 = 有效韧性 * (1.0 - Durable)
最终固定减免 = 有效韧性 * Durable
为了对抗护甲的扩展,攻击者利用四个新的反护甲属性。Resistance Piercing(抗性穿透)忽略目标原始护甲的一定百分比。Resistance Penetration(抗性穿透量)在计算完 Piercing 后减去一定数量的护甲。Toughness Piercing(韧性穿透)忽略目标原始韧性的一定百分比。Toughness Penetration(韧性穿透量)在计算完 Piercing 后减去一定数量的韧性。在进入伤害阶段之前,两种有效的防御统计数据都以相同的方式计算:
有效属性 = (原始属性 * (1.0 - Piercing)) - Penetration
真正的零战斗
原版战斗依赖于硬编码的 1.5 倍暴击伤害乘数以及专门针对剑的硬编码 1 点伤害横扫攻击。我移除了这些规则以建立真正的零基准。如果你的自定义属性为零,你的武器将对单个目标造成恰好等于其基础伤害的伤害,且没有粒子效果或幽灵伤害。
Critical Efficiency(暴击效率)直接将一个百分比添加到你的基础伤害乘数中。Critical Damage(暴击伤害)在乘数应用后,向最终打击添加一个固定的伤害值。
最终暴击伤害 = (基础伤害 * (1.0 + Critical Efficiency)) + Critical Damage
Sweeping Efficiency(横扫效率)决定了你的基础伤害中有多少百分比会延续到横扫半径内。Sweeping Damage(横扫伤害)在百分比计算之后,向横扫区域添加一个固定的伤害值。
横扫伤害输出 = (基础伤害 * Sweeping Efficiency) + Sweeping Damage
由于横扫严格由这些数值属性决定,任何物品,包括斧头或空手,只要拥有适当的属性,都可以执行横扫攻击。
物理与魔法
数学框架延伸至实体速度和状态效果,以消除任意的机制。
原版的击退抗性依赖于完全忽略击退的百分比几率,本质上相当于一个随机数生成器。我引入了 Knockback Toughness(击退韧性),它在原版百分比抗性之前作为对物理速度的固定减少量起作用。
有效击退 = (原始击退 - Knockback Toughness) * (1.0 - Knockback Resistance)
那些烦人的银鱼无法在你的新厚实多汁的抗性下将你扔进熔岩,但像劫掠兽这样的高冲击实体仍将输出足够的原始速度,以绕过固定减免计算。
Effect Affinity(效果亲和力)和 Effect Power(效果强度)改变了玩家身体处理药水持续时间的 tick 数的比例,其中 20 ticks 等于 1 秒。这些属性直接应用于接收实体。对于有益效果如再生(Regeneration),持续时间乘以你的 Effect Affinity 百分比,然后由你的 Effect Power 决定的固定 tick 值延长。
有益持续时间 = (基础持续时间 * (1.0 + Effect Affinity)) + (Effect Power * 20)
对于有害效果如中毒(Poison),持续时间乘以你的 Effect Affinity 百分比的倒数,然后减去由 Effect Power 决定的固定 tick 值。
有害持续时间 = MAX(0, (基础持续时间 * MAX(0, 1.0 - Effect Affinity)) - (Effect Power * 20))
达到高亲和力会在数学上强制负面状态效果立即过期。
配置与整合包集成
后端配置提供了对数学引擎变量的直接控制。通用配置文件允许你调整 Armor Constant(护甲常数),以调节或加速整个游戏中的护甲扩展。你还可以调整 Toughness Multiplier(韧性乘数),以精确定义一点韧性提供多少固定伤害减免。
武器行为通过物品标签而非硬编码实例检查来控制。你可以将物品分配给特定的数据包标签,以规定其机制,而无需编写 Java 代码。可用的横扫标签为 buckshot:attack_style/sweeps_always、buckshot:attack_style/sweeps_never 和 buckshot:attack_style/sweeps_sprinting。暴击使用完全相同的标签结构,只需将 sweeps 一词替换为 crits 即可。
默认情况下,系统强制执行互斥,这意味着实体在掉落或执行暴击时无法触发横扫攻击,除非有特定标签覆盖该行为。
Buckshot's Attributes
I replaced the combat, physics, and magic calculations in Minecraft with a standardized mathematical framework. All calculations follow a strict order of operations where percentage modifiers are applied first, followed by flat modifiers. I introduced 12 new dynamic attributes to support custom scaling for modpack developers and players.
The Armor Engine and Anti-Armor
The vanilla Minecraft armor formula is fundamentally flawed. Nobody actually knows how it works under the hood, it breaks completely when mods introduce high numerical values, and it is entirely inelastic when trying to integrate it with other custom combat systems.
I replaced the vanilla calculation with a standard diminishing returns formula:
Damage Reduction Percentage = Effective Armor / (Effective Armor + C)
Where C is a configurable constant defaulting to 20.0. This ensures infinite numerical scaling without the entity ever reaching complete damage immunity.
Armor Toughness has been mathematically reworked into a flat damage reduction variable rather than an arbitrary buffer. The new Durable attribute dictates the timing of this flat reduction within the equation. A Durable value of 0.5 means half of your Toughness reduces incoming damage before the armor percentage reduction is calculated, and the remaining half is subtracted from the final damage after the percentage reduction is applied. The logic follows this structure:
Initial Flat Reduction = Effective Toughness * (1.0 - Durable)
Final Flat Reduction = Effective Toughness * Durable
To counter armor scaling, attackers utilize four new Anti-Armor attributes. Resistance Piercing ignores a percentage of the target's raw Armor. Resistance Penetration subtracts a flat amount of Armor after Piercing is calculated. Toughness Piercing ignores a percentage of the target's raw Toughness. Toughness Penetration subtracts a flat amount of Toughness after Piercing is calculated. Both effective defensive stats are calculated identically before the damage phase begins:
Effective Stat = (Raw Stat * (1.0 - Piercing)) - Penetration
True Zero Combat
Vanilla combat relies on a hardcoded 1.5x damage multiplier for critical hits and a hardcoded 1-damage sweeping attack specifically for swords. I removed these rules to establish a True Zero baseline. If your custom attributes are at zero, your weapon deals exactly its base damage to a single target with no particle effects or ghost damage.
Critical Efficiency adds a percentage directly to your base damage multiplier. Critical Damage adds a flat damage value to the final strike after the multiplier is applied.
Final Critical Damage = (Base Damage * (1.0 + Critical Efficiency)) + Critical Damage
Sweeping Efficiency determines the percentage of your base damage that carries over to the sweep radius. Sweeping Damage adds a flat damage value to the sweeping area after the percentage calculation.
Sweeping Damage Output = (Base Damage * Sweeping Efficiency) + Sweeping Damage
Because sweeping is dictated strictly by these numeric attributes, any item, including an axe or a bare hand, can perform a sweeping attack if granted the appropriate stats.
Physics and Magic
The mathematical framework extends to entity velocity and status effects to remove arbitrary mechanics.
Vanilla Knockback Resistance relies on a percentage chance to ignore knockback entirely, operating essentially as a random number generator. I introduced Knockback Toughness, which acts as a flat reduction to physical velocity applied before the vanilla percentage resistance.
Effective Knockback = (Raw Knockback - Knockback Toughness) * (1.0 - Knockback Resistance)
Those pesky silverfish won't be able to throw you in lava under your new thick and juicy resistances, but high-impact entities like Ravagers will still output enough raw velocity to bypass the flat reduction calculation.
Effect Affinity and Effect Power alter how the player's body processes potion durations in ticks, where 20 ticks equal 1 second. These stats apply directly to the receiving entity. For beneficial effects like Regeneration, the duration is multiplied by your Effect Affinity percentage, and then extended by a flat tick value dictated by your Effect Power.
Beneficial Duration = (Base Duration * (1.0 + Effect Affinity)) + (Effect Power * 20)
For harmful effects like Poison, the duration is multiplied by the inverse of your Effect Affinity percentage, and then reduced by the flat Effect Power value in ticks.
Harmful Duration = MAX(0, (Base Duration * MAX(0, 1.0 - Effect Affinity)) - (Effect Power * 20))
Reaching high Affinity mathematically forces negative status effects to expire instantly.
Configuration and Modpack Integration
The backend configuration provides direct control over the math engine variables. The common configuration file allows you to adjust the Armor Constant to throttle or accelerate armor scaling across the entire game. You can also adjust the Toughness Multiplier to define exactly how much flat damage reduction one point of Toughness provides.
Weapon behaviors are controlled via item tags rather than hardcoded instance checks. You can assign items to specific datapack tags to dictate their mechanics without writing Java code. The available sweeping tags are buckshot:attack_style/sweeps_always, buckshot:attack_style/sweeps_never, and buckshot:attack_style/sweeps_sprinting. Critical hits use the exact same tag structure replacing the word sweeps with crits.
By default, the system enforces mutual exclusion, meaning a sweeping attack cannot be triggered while the entity is falling or performing a critical hit, unless a specific tag overrides the behavior.
评论 0
登录后参与评分
还没有评论,来抢沙发吧